Type Alias TrieSearchOptions
cache?: boolean;
expandRegexes?: [{ alternate: string; regex: RegExp }];
ignoreCase?: boolean;
insertFullUnsplitKey?: boolean;
maxCacheSize?: number;
min?: number;
splitOnGetRegEx?: RegExp | false;
splitOnRegEx?: RegExp | false;
tokenizer?: (str: string) => IterableIterator<string>;
}
Type declaration
Optional
cache?: booleanIs caching enabled; default: true.
Optional
expandRegexes?: [{ alternate: string; regex: RegExp }]By default, this is set to an array of international vowels expansions, allowing searches for vowels like 'a' to return matches on 'å' or 'ä' etc. Set this to an empty array /
[]
if you want to disable it. See the top ofsrc/trie/TrieSearch.js
file for examples.Optional
ignoreCase?: booleanIgnores case in lookups; default:
true
.Optional
insertFullUnsplitKey?: booleanIn
TrieSearch.map
whensplitOnRegEx
is defined andinsertFullUnsplitKey
is true the full key will also be mapped; default:false
.Optional
maxCacheSize?: numberThe max cache size before removing entries in a LRU manner; default:
64
.Optional
min?: numberThe size of the prefix for keys; minimum length of a key to store and search. By default, this is
1
, but you might improve performance by using2
or3
.Optional
splitOnGetRegEx?: RegExp | falseHow phrases are split on retrieval / get; default:
/\s/g
.Optional
splitOnRegEx?: RegExp | falseHow phrases are split on search; default:
/\s/g
. By default, this is any whitespace. Set tofalse
if you have whitespace in your keys! Set it to something else to split along other boundaries.Optional
tokenizer?: (str: string) => IterableIterator<string>Provide a custom tokenizer that is used to split keys. IE a Grapheme / Unicode tokenizer.
Options for TrieSearch.