Preparing search index...

    Module FuzzyIndex

    FuzzyIndex - All in-memory fuzzy text search lives here.

    Two layers:

    • Low-level: buildFuzzyIndex + fuzzySearchIds / fuzzyHasMatch operate on a raw string[] corpus and return position indices or a boolean. Use when the caller already has its own object model.

    • Typed-corpus: buildItemIndex<T> + searchItems / searchItemsDetailed keep the original objects alongside the index, apply optional per-name preprocessing, and prioritize exact matches. This is what hooks like useTags / useIngredients consume.

    • Phrase preset: buildPhraseIndex builds an index whose entries match as whole phrases (single token each). Used by OCR to test whether a recognized line matches any known nutrition label.

    Tuning of fuzzy thresholds and the choice of preprocessing live with the caller; FuzzyIndex does not know about tags, ingredients, OCR or any domain concept.

    FuzzyIndex
    FuzzyIndexOptions
    ItemIndexConfig
    ItemSearchIndex
    DetailedSearchResult
    ITEM_FUZZY
    wholePhraseTokenizer
    buildFuzzyIndex
    fuzzySearchIds
    fuzzyHasMatch
    makeItemIndexCache
    buildItemIndex
    searchItemsDetailed
    searchItems
    searchItemsFuzzy
    buildPhraseIndex