@squawk
    Preparing search index...

    Interface FuzzySearchOptions<T, F>

    Options controlling a fuzzySearch run.

    interface FuzzySearchOptions<T, F extends string = string> {
        filter?: (item: T) => boolean;
        keys: (item: T) => readonly SearchField<F>[];
        limit?: number;
        minScore?: number;
    }

    Type Parameters

    • T

      The item type being searched.

    • F extends string = string

      The field-name type, inferred from the fields returned by FuzzySearchOptions.keys.

    Index

    Properties

    filter?: (item: T) => boolean

    Optional predicate applied before scoring. Items for which it returns false are excluded entirely, letting callers honour visibility or type filters without the engine knowing anything about the domain.

    Type Declaration

      • (item: T): boolean
      • Parameters

        • item: T

          The item to test.

        Returns boolean

        true to keep the item, false to drop it.

    keys: (item: T) => readonly SearchField<F>[]

    Extracts the searchable fields from an item. Every returned field is scored; the highest-scoring one determines the item's rank.

    Type Declaration

      • (item: T): readonly SearchField<F>[]
      • Parameters

        • item: T

          The item to extract fields from.

        Returns readonly SearchField<F>[]

        The fields to score for this item.

    limit?: number

    Maximum number of results to return. Defaults to 20.

    minScore?: number

    Minimum score (exclusive) an item must reach to be included. Defaults to 0, which keeps every item that matches at all and drops only true non-matches. Raise it to suppress weak (subsequence or typo) matches.