@yoch/frozenminisearch v1.12.1
    Preparing search index...

    Class FrozenMiniSearch<T>

    Type Parameters

    • T = any

    Hierarchy

    • default<T>
      • FrozenMiniSearch
    Index
    wildcard: typeof WILDCARD_QUERY = WILDCARD_QUERY
    • External ids of the documents matching query, in insertion order, without scores, match information or result objects (FrozenMiniSearch extension). They are the documents of an unbounded search with the same options.

      A filter, local or from the index-level search options, throws: it needs complete results. Pass filter: undefined to disable an index-level filter. A local limit throws too, since the method returns every match; an index-level limit is ignored. boostDocument must be deterministic. As in search, a document does not match a query term when it returns a falsy value for every term derived from it (exact, prefix or fuzzy). A wildcard query returns every document without calling it, since search keeps them all, with their boosted scores.

      Parameters

      Returns unknown[]

    • Export this index as a MiniSearch wire snapshot (serializationVersion: 2). Use for migration or interchange with the minisearch package (JSON.stringify works via this method). Term order in index may differ from MiniSearch native toJSON; search scores stay equivalent.

      Returns MiniSearchSnapshot

    • Build a new frozen index from a MiniSearch JSON snapshot string (import / migration). Accepts the wire format produced by MiniSearch toJSON or by toJSON on this class. No runtime dependency on the minisearch package.

      Type Parameters

      • T
      • I extends FrozenMiniSearchCore<T>

      Parameters

      • this: FrozenMiniSearchCtor<T, I>
      • json: string
      • options: Options<T> = ...

      Returns I

    • Built-in default for indexing / load options (tokenize, processTerm, extractField, …).

      Type Parameters

      • K extends
            | "tokenize"
            | "processTerm"
            | "idField"
            | "extractField"
            | "stringifyField"
            | "storeFields"

      Parameters

      • optionName: K

      Returns {
          extractField: (document: any, fieldName: string) => any;
          idField: string;
          processTerm: (term: string) => string;
          storeFields: string[];
          stringifyField: (fieldValue: any) => any;
          tokenize: (text: string) => string[];
      }[K]