Class TermVectors
- Direct Known Subclasses:
TermVectorsReader
NOTE: This class is not thread-safe and should only be consumed in the thread where it was acquired.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TermVectorsInstance that never returns term vectors -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Fieldsget(int doc) Returns term vectors for this document, or null if term vectors were not indexed.final TermsRetrieve term vector for this document and field, or null if term vectors were not indexed.voidprefetch(int docID) Optional method: Give a hint to thisTermVectorsinstance that the given document will be read in the near future.
-
Field Details
-
EMPTY
Instance that never returns term vectors
-
-
Constructor Details
-
TermVectors
protected TermVectors()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
prefetch
Optional method: Give a hint to thisTermVectorsinstance that the given document will be read in the near future. This typically delegates toIndexInput.prefetch(long, long)and is useful to parallelize I/O across multiple documents.NOTE: This API is expected to be called on a small enough set of doc IDs that they could all fit in the page cache. If you plan on retrieving a very large number of documents, it may be a good idea to perform calls to
prefetch(int)andget(int)in batches instead of prefetching all documents up-front.- Throws:
IOException
-
get
Returns term vectors for this document, or null if term vectors were not indexed.The returned Fields instance acts like a single-document inverted index (the docID will be 0). If offsets are available they are in an
OffsetAttributeavailable from thePostingsEnum.- Throws:
IOException
-
get
Retrieve term vector for this document and field, or null if term vectors were not indexed.The returned Terms instance acts like a single-document inverted index (the docID will be 0). If offsets are available they are in an
OffsetAttributeavailable from thePostingsEnum.- Throws:
IOException
-