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>);
}

Options for TrieSearch.

Type declaration

  • Optionalcache?: boolean

    Is caching enabled; default: true.

  • OptionalexpandRegexes?: [{
        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 of src/trie/TrieSearch.js file for examples.

  • OptionalignoreCase?: boolean

    Ignores case in lookups; default: true.

  • OptionalinsertFullUnsplitKey?: boolean

    In TrieSearch.map when splitOnRegEx is defined and insertFullUnsplitKey is true the full key will also be mapped; default: false.

  • OptionalmaxCacheSize?: number

    The max cache size before removing entries in a LRU manner; default: 64.

  • Optionalmin?: number

    The 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 using 2 or 3.

  • OptionalsplitOnGetRegEx?: RegExp | false

    How phrases are split on retrieval / get; default: /\s/g.

  • OptionalsplitOnRegEx?: RegExp | false

    How phrases are split on search; default: /\s/g. By default, this is any whitespace. Set to false if you have whitespace in your keys! Set it to something else to split along other boundaries.

  • Optionaltokenizer?: ((str: string) => IterableIterator<string>)

    Provide a custom tokenizer that is used to split keys. IE a Grapheme / Unicode tokenizer.