Patricia trie/Radix tree implementation for document querying system