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

    Class FrozenMiniSearch<T>

    Type Parameters

    • T = any

    Hierarchy

    • default<T>
      • FrozenMiniSearch
    Index

    Constructors

    Properties

    wildcard: typeof WILDCARD_QUERY = WILDCARD_QUERY

    Accessors

    Methods

    • 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

    • Same as fromJson with a pre-parsed snapshot object. storedFields are shallow-copied; callers must not mutate nested values after load if they intend to keep the index immutable.

      Type Parameters

      • T
      • I extends FrozenMiniSearchCore<T>

      Parameters

      • this: FrozenMiniSearchCtor<T, I>
      • snapshot: MiniSearchSnapshot
      • options: Options<T> = ...

      Returns I

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

      Type Parameters

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

      Parameters

      • optionName: K

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