Interface ISearchIndex<T>

A collection where all representations (T) of data (D) are indexed upon insertion for efficient querying based on given configuration Use cases include:

  • Search feature which returns relevant results with the option to support "autocomplete" functionality
  • Answering potentially complex but predictable questions based on parameters of an "indexer" function
interface ISearchIndex<T> {
    Answer(query): Promise<null | T>;
    GetIndexesForQuery(query, limit?): Promise<string[]>;
    Insert<D>(indexer, data?): Promise<void>;
    Reset(): void;
    Search(query, limit?): Promise<T[]>;
}

Type Parameters

  • T

Implemented by

Methods

  • Return the best match indexes for a given query (consider for an autocomplete feature)

    Parameters

    • query: string
    • Optional limit: number

    Returns Promise<string[]>

Generated using TypeDoc