SuggestionTrie
A Radix trie for suggestion search, it allows to search for data indexed by a set of keywords fast.
- Compressed trie by default, more memory efficient for sparse tries
- It supports a simple fuzzy to fix typos in the search.
- Customizable suggestions data, you can add anything associated with a word or a set of words.
- Non-fuzzy suggestion retrieval in µs to ns.
Examples
Search for a word (in this example a password) in a list with +256M entries in µs.

Find data associated with a word like file paths.

Usage
Cargo.toml
toml
suggestion_trie = "0.1.0"
Code example
```rust
use suggestiontrie::{TrieRoot, TrieInputData};
use suggestiontrie::Suggestion;
let mut trieroot: TrieRoot = TrieRoot::::new(5, Some(100));
// Get the data you want to insert into the trie
let entries = vec![
// Use lowercase keywords and query if you want to do case insensitive searches
TrieInputData {
suggestion: Suggestion::new("Rat".tostring(), Some(4)),
keywords: vec!["Mice".tostring(), "Rat".tostring(), "Mouse".tostring(), "Rodent".tostring()],
},
TrieInputData {
suggestion: Suggestion::new("Cat".tostring(), Some(8000)),
keywords: vec!["Cat".tostring(), "Kitten".tostring(), "Kitty".tostring()],
}
];
// Build the trie
trie_root.build(&entries);
// Search and get results
let results = trieroot.getsuggestions("Rodent");
assert_eq!(results.unwrap()[0].title, "Rat");
```
Docs
check the docs here