Module org.apache.lucene.codecs
Class SimpleTextTermVectorsReader
java.lang.Object
org.apache.lucene.index.TermVectors
org.apache.lucene.codecs.TermVectorsReader
org.apache.lucene.codecs.simpletext.SimpleTextTermVectorsReader
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable
Reads plain-text term vectors.
FOR RECREATIONAL USE ONLY
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static classprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IndexInputprivate long[]private BytesRefBuilderprivate CharsRefBuilderFields inherited from class org.apache.lucene.index.TermVectors
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionSimpleTextTermVectorsReader(long[] offsets, IndexInput in) SimpleTextTermVectorsReader(Directory directory, SegmentInfo si, IOContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks consistency of this reader.clone()Create a clone that one caller at a time may use to read term vectors.voidclose()get(int doc) Returns term vectors for this document, or null if term vectors were not indexed.private intparseIntAt(int offset) private voidreadIndex(int maxDoc) private voidreadLine()private StringreadString(int offset, BytesRefBuilder scratch) toString()Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstanceMethods inherited from class org.apache.lucene.index.TermVectors
get
-
Field Details
-
offsets
private long[] offsets -
in
-
scratch
-
scratchUTF16
-
-
Constructor Details
-
SimpleTextTermVectorsReader
public SimpleTextTermVectorsReader(Directory directory, SegmentInfo si, IOContext context) throws IOException - Throws:
IOException
-
SimpleTextTermVectorsReader
SimpleTextTermVectorsReader(long[] offsets, IndexInput in)
-
-
Method Details
-
readIndex
- Throws:
IOException
-
get
Description copied from class:TermVectorsReturns 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.- Specified by:
getin classTermVectors- Throws:
IOException
-
clone
Description copied from class:TermVectorsReaderCreate a clone that one caller at a time may use to read term vectors.- Specified by:
clonein classTermVectorsReader
-
close
- Throws:
IOException
-
readLine
- Throws:
IOException
-
parseIntAt
private int parseIntAt(int offset) -
readString
-
toString
-
checkIntegrity
Description copied from class:TermVectorsReaderChecks 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:
checkIntegrityin classTermVectorsReader- Throws:
IOException
-