Preparing search index...

    Type Alias ItemIndexConfig<T>

    Configuration for buildItemIndex.

    preprocess is applied both when indexing each item's name and when a query is later passed to searchItems / searchItemsDetailed, so the two sides reach the same normalized form (e.g. stripping parentheticals for ingredient queries).

    type ItemIndexConfig<T> = {
        fuzzy: number;
        getName: (item: T) => string;
        preprocess?: (text: string) => string;
        combineWith?: "OR" | "AND";
    }

    Type Parameters

    • T
    Index
    fuzzy: number
    getName: (item: T) => string
    preprocess?: (text: string) => string
    combineWith?: "OR" | "AND"

    How multi-token queries combine. Defaults to 'OR' (any token matches). Use 'AND' for multi-word names where a single shared common word (e.g. "Recipe", "Salad") should not by itself flag similarity.