Class 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

    • Field Detail

      • BASE_RAM_BYTES_USED

        private static final long BASE_RAM_BYTES_USED
      • offsets

        private long[] offsets
    • 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 an OffsetAttribute available from the PostingsEnum.
        Specified by:
        get in class TermVectorsReader
        Throws:
        java.io.IOException
      • 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 class java.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 class TermVectorsReader
        Throws:
        java.io.IOException