Function searchIndex

  • Function querying an existing search index.

    Returns

    Returns an array of matches sorted by scores descending (starting with the most relevant item).

    Parameters

    • index: Index

      The search index build previously.

    • query: string

      A word or sequence of words for searching the text corpus.

    • options: Partial<QueryOptions>

      The exactly same options as provided to the function for creating the index.

    • analyzer: Analyzer = DEFAULT_ANALYZER
    • tokenizer: Tokenizer = DEFAULT_TOKENIZER

    Returns Promise<SearchResults>