build method

Index build()

Builds the index, creating an instance of Index.

This completes the indexing process and should only be called once all documents have been added to the index.

Implementation

Index build() {
  _calculateAverageFieldLengths();
  _createFieldVectors();
  _createTokenSet();

  return Index(
      invertedIndex: invertedIndex,
      fieldVectors: fieldVectors,
      tokenSet: tokenSet,
      fields: _fields.keys.toList(),
      pipeline: searchPipeline);
}