Interface FuzzyIndexConfig

What a FuzzyIndex is made with.

interface FuzzyIndexConfig {
    fields: Record<string, number>;
    passageFields?: readonly string[];
    tokenize?: FuzzyTokenizer;
    editMinLength?: number;
    passages?: number;
    passageWidth?: number;
}

Properties

fields: Record<string, number>

Each field's name and its weight, a finite number above 0.

passageFields?: readonly string[]

The fields whose sentences and lines make a hit's passages, in this order.

Default

the fields of the lowest weight
tokenize?: FuzzyTokenizer

The words of a text.

Default

the library's word rule with an apostrophe inside a word kept
editMinLength?: number

The fewest letters a query word and a stored word each need to match one edit apart.

Default

4
passages?: number

The most passages a hit shows: a whole number, 0 or more.

Default

3
passageWidth?: number

About how many characters a passage keeps around its first match: a whole number, 1 or more.

Default

160