StoredFieldsReader

Codec API for reading stored fields.

You need to implement .document to read the stored fields for a document, implement .clone (creating clones of any IndexInputs used, etc), and .close

Inheritors

Properties

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun checkIntegrity()

Checks consistency of this reader.

Link copied to clipboard
abstract override fun clone(): StoredFieldsReader
Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
fun document(docID: Int): Document

Returns the stored fields of the nth Document in this index. This is just sugar for using DocumentStoredFieldVisitor.

fun document(docID: Int, fieldsToLoad: MutableSet<String>): Document

Like .document but only loads the specified fields. Note that this is simply sugar for DocumentStoredFieldVisitor.DocumentStoredFieldVisitor.

abstract fun document(docID: Int, visitor: StoredFieldVisitor)

Expert: visits the fields of a stored document, for custom processing/loading of each field. If you simply want to load all fields, use .document. If you want to load a subset, use DocumentStoredFieldVisitor.

Link copied to clipboard
open fun prefetch(docID: Int)

Optional method: Give a hint to this StoredFields instance that the given document will be read in the near future. This typically delegates to IndexInput.prefetch and is useful to parallelize I/O across multiple documents.