Class PushPostingsWriterBase

    • Field Detail

      • enumFlags

        private int enumFlags
      • writeFreqs

        protected boolean writeFreqs
        True if the current field writes freqs.
      • writePositions

        protected boolean writePositions
        True if the current field writes positions.
      • writePayloads

        protected boolean writePayloads
        True if the current field writes payloads.
      • writeOffsets

        protected boolean writeOffsets
        True if the current field writes offsets.
    • Constructor Detail

      • PushPostingsWriterBase

        protected PushPostingsWriterBase()
        Sole constructor. (For invocation by subclass constructors, typically implicit.)
    • Method Detail

      • newTermState

        public abstract BlockTermState newTermState()
                                             throws java.io.IOException
        Return a newly created empty TermState
        Throws:
        java.io.IOException
      • startTerm

        public abstract void startTerm​(NumericDocValues norms)
                                throws java.io.IOException
        Start a new term. Note that a matching call to finishTerm(BlockTermState) is done, only if the term has at least one document.
        Throws:
        java.io.IOException
      • finishTerm

        public abstract void finishTerm​(BlockTermState state)
                                 throws java.io.IOException
        Finishes the current term. The provided BlockTermState contains the term's summary statistics, and will holds metadata from PBF when returned
        Throws:
        java.io.IOException
      • setField

        public int setField​(FieldInfo fieldInfo)
        Sets the current field for writing, and returns the fixed length of long[] metadata (which is fixed per field), called when the writing switches to another field.
        Specified by:
        setField in class PostingsWriterBase
      • writeTerm

        public final BlockTermState writeTerm​(BytesRef term,
                                              TermsEnum termsEnum,
                                              FixedBitSet docsSeen,
                                              NormsProducer norms)
                                       throws java.io.IOException
        Description copied from class: PostingsWriterBase
        Write all postings for one term; use the provided TermsEnum to pull a PostingsEnum. This method should not re-position the TermsEnum! It is already positioned on the term that should be written. This method must set the bit in the provided FixedBitSet for every docID written. If no docs were written, this method should return null, and the terms dict will skip the term.
        Specified by:
        writeTerm in class PostingsWriterBase
        Throws:
        java.io.IOException
      • startDoc

        public abstract void startDoc​(int docID,
                                      int freq)
                               throws java.io.IOException
        Adds a new doc in this term. freq will be -1 when term frequencies are omitted for the field.
        Throws:
        java.io.IOException
      • addPosition

        public abstract void addPosition​(int position,
                                         BytesRef payload,
                                         int startOffset,
                                         int endOffset)
                                  throws java.io.IOException
        Add a new position and payload, and start/end offset. A null payload means no payload; a non-null payload with zero length also means no payload. Caller may reuse the BytesRef for the payload between calls (method must fully consume the payload). startOffset and endOffset will be -1 when offsets are not indexed.
        Throws:
        java.io.IOException
      • finishDoc

        public abstract void finishDoc()
                                throws java.io.IOException
        Called when we are done adding positions and payloads for each doc.
        Throws:
        java.io.IOException