Module org.apache.lucene.core
Package org.apache.lucene.index
Class SlowCompositeCodecReaderWrapper.SlowCompositeTermVectorsReaderWrapper
java.lang.Object
org.apache.lucene.index.TermVectors
org.apache.lucene.codecs.TermVectorsReader
org.apache.lucene.index.SlowCompositeCodecReaderWrapper.SlowCompositeTermVectorsReaderWrapper
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Cloneable
- Enclosing class:
SlowCompositeCodecReaderWrapper
private class SlowCompositeCodecReaderWrapper.SlowCompositeTermVectorsReaderWrapper
extends TermVectorsReader
-
Field Summary
FieldsFields inherited from class org.apache.lucene.index.TermVectors
EMPTY
-
Constructor Summary
ConstructorsConstructorDescriptionSlowCompositeTermVectorsReaderWrapper
(TermVectorsReader[] readers, int[] docStarts) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Checks consistency of this reader.clone()
Create a clone that one caller at a time may use to read term vectors.void
close()
get
(int doc) Returns term vectors for this document, or null if term vectors were not indexed.void
prefetch
(int doc) Optional method: Give a hint to thisTermVectors
instance that the given document will be read in the near future.Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstance
Methods inherited from class org.apache.lucene.index.TermVectors
get
-
Field Details
-
readers
-
docStarts
private final int[] docStarts
-
-
Constructor Details
-
SlowCompositeTermVectorsReaderWrapper
SlowCompositeTermVectorsReaderWrapper(TermVectorsReader[] readers, int[] docStarts)
-
-
Method Details
-
close
- Throws:
IOException
-
clone
Description copied from class:TermVectorsReader
Create a clone that one caller at a time may use to read term vectors.- Specified by:
clone
in classTermVectorsReader
-
checkIntegrity
Description copied from class:TermVectorsReader
Checks consistency of this reader.Note that this may be costly in terms of I/O, e.g. may involve computing a checksum value against large data files.
- Specified by:
checkIntegrity
in classTermVectorsReader
- Throws:
IOException
-
prefetch
Description copied from class:TermVectors
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
TermVectors.prefetch(int)
andTermVectors.get(int)
in batches instead of prefetching all documents up-front.- Overrides:
prefetch
in classTermVectors
- Throws:
IOException
-
get
Description copied from class:TermVectors
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
.- Specified by:
get
in classTermVectors
- Throws:
IOException
-