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 TermVectors
Instance that never returns term vectors -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Fields
get
(int doc) Returns term vectors for this document, or null if term vectors were not indexed.final Terms
Retrieve term vector for this document and field, or null if term vectors were not indexed.void
prefetch
(int docID) Optional method: Give a hint to thisTermVectors
instance 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 thisTermVectors
instance 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
OffsetAttribute
available 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
OffsetAttribute
available from thePostingsEnum
.- Throws:
IOException
-