termVectors

abstract fun termVectors(): TermVectors

Returns a TermVectors reader for the term vectors of this index.

This call never returns null, even if no term vectors were indexed. The returned instance should only be used by a single thread.

Example:

TopDocs hits = searcher.search(query, 10);
TermVectors termVectors = reader.termVectors();
for (ScoreDoc hit : hits.scoreDocs) {
Fields vector = termVectors.get(hit.doc);
}
*

Throws

IOException

If there is a low-level IO error