storedFields

Returns a StoredFields reader for the stored fields of this index.

Sugar for .getIndexReader().storedFields()

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

Example:

TopDocs hits = searcher.search(query, 10);
StoredFields storedFields = searcher.storedFields();
for (ScoreDoc hit : hits.scoreDocs) {
Document doc = storedFields.document(hit.doc);
}
*

See also

Throws

IOException

If there is a low-level IO error