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
,Accountable
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 class
SimpleTextTermVectorsReader.SimpleTVDocsEnum
private static class
SimpleTextTermVectorsReader.SimpleTVFields
private static class
SimpleTextTermVectorsReader.SimpleTVPostings
private static class
SimpleTextTermVectorsReader.SimpleTVPostingsEnum
private static class
SimpleTextTermVectorsReader.SimpleTVTerms
private static class
SimpleTextTermVectorsReader.SimpleTVTermsEnum
-
Field Summary
Fields Modifier and Type Field Description private static long
BASE_RAM_BYTES_USED
private IndexInput
in
private long[]
offsets
private BytesRefBuilder
scratch
private CharsRefBuilder
scratchUTF16
-
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 void
checkIntegrity()
Checks consistency of this reader.TermVectorsReader
clone()
Create a clone that one caller at a time may use to read term vectors.void
close()
Fields
get(int doc)
Returns term vectors for this document, or null if term vectors were not indexed.private int
parseIntAt(int offset)
long
ramBytesUsed()
Return the memory usage of this object in bytes.private void
readIndex(int maxDoc)
private void
readLine()
private java.lang.String
readString(int offset, BytesRefBuilder scratch)
java.lang.String
toString()
-
Methods inherited from class org.apache.lucene.codecs.TermVectorsReader
getMergeInstance
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED
-
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:TermVectorsReader
Returns term vectors for this document, or null if term vectors were not indexed. If offsets are available they are in anOffsetAttribute
available from thePostingsEnum
.- Specified by:
get
in classTermVectorsReader
- Throws:
java.io.IOException
-
clone
public TermVectorsReader 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
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)
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
checkIntegrity
public void checkIntegrity() throws java.io.IOException
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:
java.io.IOException
-
-