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

    Type Alias Options<T>

    Configuration options compatible with the MiniSearch constructor.

    type Options<T = any> = {
        autoSuggestOptions?: SearchOptions;
        autoVacuum?: boolean | AutoVacuumOptions;
        extractField?: (document: T, fieldName: string) => any;
        fields: string[];
        idField?: string;
        logger?: (level: LogLevel, message: string, code?: string) => void;
        processTerm?: (
            term: string,
            fieldName?: string,
        ) => string | string[] | null | undefined | false;
        searchOptions?: SearchOptions;
        storeFields?: string[];
        stringifyField?: (fieldValue: any, fieldName: string) => string;
        tokenize?: (text: string, fieldName?: string) => string[];
    }

    Type Parameters

    • T = any

      The type of documents being indexed.

    Index

    Properties

    autoSuggestOptions?: SearchOptions

    Default auto-suggest options.

    autoVacuum?: boolean | AutoVacuumOptions

    Auto-vacuum behaviour after MiniSearch discard; defaults to true.

    extractField?: (document: T, fieldName: string) => any

    Function used to extract the value of each field in documents.

    fields: string[]

    Names of the document fields to be indexed.

    idField?: string

    Name of the ID field, uniquely identifying a document. Defaults to "id".

    logger?: (level: LogLevel, message: string, code?: string) => void

    Function called to log messages from the library.

    processTerm?: (
        term: string,
        fieldName?: string,
    ) => string | string[] | null | undefined | false

    Function used to process a term before indexing or search (e.g. stemming).

    searchOptions?: SearchOptions

    Default search options.

    storeFields?: string[]

    Names of fields to store, so that search results would include them.

    stringifyField?: (fieldValue: any, fieldName: string) => string

    Function used to turn field values into strings for indexing.

    tokenize?: (text: string, fieldName?: string) => string[]

    Function used to split a field value into individual terms to be indexed.