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 class
private static class
private static class
private static class
private static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IndexInput
private long[]
private BytesRefBuilder
private CharsRefBuilder
Fields 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 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.private int
parseIntAt
(int offset) private void
readIndex
(int maxDoc) private void
readLine()
private String
readString
(int offset, BytesRefBuilder scratch) toString()
Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstance
Methods inherited from class org.apache.lucene.index.TermVectors
get, prefetch
-
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: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
-
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
-
close
- Throws:
IOException
-
readLine
- Throws:
IOException
-
parseIntAt
private int parseIntAt(int offset) -
readString
-
toString
-
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
-