Type alias TextFieldIndex

TextFieldIndex: {
    docCount: number;
    docFreqsByToken: TrieNode<[number, number]>;
    docLengths: {
        [key: string]: number;
    };
    totalDocLengths: number;
}

The search index returned after building the index and used for running search queries. For normal use cases, the semantics of the fields of this data structure do not matter to the user.

Type declaration

  • docCount: number

    The count of documents.

  • docFreqsByToken: TrieNode<[number, number]>

    A mapping of tokens to an array, in which the first value is the document ID this token is present and the second value equals to the frequency of that token in the document.

  • docLengths: {
        [key: string]: number;
    }

    A mapping for retrieving the length, i.e. the count of words, of a document by its ID.

    • [key: string]: number
  • totalDocLengths: number

    The sum of lengths of all documents.