Class SimpleTextTermVectorsWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, Accountable

    public class SimpleTextTermVectorsWriter
    extends TermVectorsWriter
    Writes plain-text term vectors.

    FOR RECREATIONAL USE ONLY

    • Field Detail

      • NUMFIELDS

        static final BytesRef NUMFIELDS
      • FIELDNAME

        static final BytesRef FIELDNAME
      • FIELDPOSITIONS

        static final BytesRef FIELDPOSITIONS
      • FIELDOFFSETS

        static final BytesRef FIELDOFFSETS
      • FIELDPAYLOADS

        static final BytesRef FIELDPAYLOADS
      • FIELDTERMCOUNT

        static final BytesRef FIELDTERMCOUNT
      • TERMTEXT

        static final BytesRef TERMTEXT
      • TERMFREQ

        static final BytesRef TERMFREQ
      • POSITION

        static final BytesRef POSITION
      • PAYLOAD

        static final BytesRef PAYLOAD
      • STARTOFFSET

        static final BytesRef STARTOFFSET
      • ENDOFFSET

        static final BytesRef ENDOFFSET
      • numDocsWritten

        private int numDocsWritten
      • offsets

        private boolean offsets
      • positions

        private boolean positions
      • payloads

        private boolean payloads
    • Constructor Detail

      • SimpleTextTermVectorsWriter

        public SimpleTextTermVectorsWriter​(Directory directory,
                                           java.lang.String segment,
                                           IOContext context)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • addPosition

        public void addPosition​(int position,
                                int startOffset,
                                int endOffset,
                                BytesRef payload)
                         throws java.io.IOException
        Description copied from class: TermVectorsWriter
        Adds a term position and offsets
        Specified by:
        addPosition in class TermVectorsWriter
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class TermVectorsWriter
        Throws:
        java.io.IOException
      • write

        private void write​(java.lang.String s)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        private void write​(BytesRef bytes)
                    throws java.io.IOException
        Throws:
        java.io.IOException
      • newLine

        private void newLine()
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.