Class SimpleTextTermVectorsReader
- java.lang.Object
-
- org.apache.lucene.codecs.TermVectorsReader
-
- org.apache.lucene.codecs.simpletext.SimpleTextTermVectorsReader
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Cloneable
public class SimpleTextTermVectorsReader extends TermVectorsReader
Reads plain-text term vectors.FOR RECREATIONAL USE ONLY
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classSimpleTextTermVectorsReader.SimpleTVDocsEnumprivate static classSimpleTextTermVectorsReader.SimpleTVFieldsprivate static classSimpleTextTermVectorsReader.SimpleTVPostingsprivate static classSimpleTextTermVectorsReader.SimpleTVPostingsEnumprivate static classSimpleTextTermVectorsReader.SimpleTVTermsprivate static classSimpleTextTermVectorsReader.SimpleTVTermsEnum
-
Field Summary
Fields Modifier and Type Field Description private IndexInputinprivate long[]offsetsprivate BytesRefBuilderscratchprivate CharsRefBuilderscratchUTF16
-
Constructor Summary
Constructors Constructor Description SimpleTextTermVectorsReader(long[] offsets, IndexInput in)SimpleTextTermVectorsReader(Directory directory, SegmentInfo si, IOContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckIntegrity()Checks consistency of this reader.TermVectorsReaderclone()Create a clone that one caller at a time may use to read term vectors.voidclose()Fieldsget(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 java.lang.StringreadString(int offset, BytesRefBuilder scratch)java.lang.StringtoString()-
Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstance
-
-
-
-
Field Detail
-
offsets
private long[] offsets
-
in
private IndexInput in
-
scratch
private BytesRefBuilder scratch
-
scratchUTF16
private CharsRefBuilder scratchUTF16
-
-
Constructor Detail
-
SimpleTextTermVectorsReader
public SimpleTextTermVectorsReader(Directory directory, SegmentInfo si, IOContext context) throws java.io.IOException
- Throws:
java.io.IOException
-
SimpleTextTermVectorsReader
SimpleTextTermVectorsReader(long[] offsets, IndexInput in)
-
-
Method Detail
-
readIndex
private void readIndex(int maxDoc) throws java.io.IOException- Throws:
java.io.IOException
-
get
public Fields get(int doc) throws java.io.IOException
Description copied from class:TermVectorsReaderReturns term vectors for this document, or null if term vectors were not indexed. If offsets are available they are in anOffsetAttributeavailable from thePostingsEnum.- Specified by:
getin classTermVectorsReader- Throws:
java.io.IOException
-
clone
public TermVectorsReader 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
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
readLine
private void readLine() throws java.io.IOException- Throws:
java.io.IOException
-
parseIntAt
private int parseIntAt(int offset)
-
readString
private java.lang.String readString(int offset, BytesRefBuilder scratch)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
checkIntegrity
public void checkIntegrity() throws java.io.IOExceptionDescription 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:
java.io.IOException
-
-