Class TermsHashPerField

    • Constructor Detail

      • TermsHashPerField

        public TermsHashPerField​(int streamCount,
                                 FieldInvertState fieldState,
                                 TermsHash termsHash,
                                 TermsHashPerField nextPerField,
                                 FieldInfo fieldInfo)
        streamCount: how many streams this field stores per term. E.g. doc(+freq) is 1 stream, prox+offset is a second.
    • Method Detail

      • reset

        void reset()
      • initReader

        public void initReader​(ByteSliceReader reader,
                               int termID,
                               int stream)
      • sortPostings

        public int[] sortPostings()
        Collapse the hash table and sort in-place; also sets this.sortedTermIDs to the results
      • add

        public void add​(int textStart)
                 throws java.io.IOException
        Throws:
        java.io.IOException
      • add

        void add()
          throws java.io.IOException
        Called once per inverted token. This is the primary entry point (for first TermsHash); postings use this API.
        Throws:
        java.io.IOException
      • writeByte

        void writeByte​(int stream,
                       byte b)
      • writeBytes

        public void writeBytes​(int stream,
                               byte[] b,
                               int offset,
                               int len)
      • writeVInt

        void writeVInt​(int stream,
                       int i)
      • finish

        void finish()
             throws java.io.IOException
        Finish adding all instances of this field to the current document.
        Throws:
        java.io.IOException
      • start

        boolean start​(IndexableField field,
                      boolean first)
        Start adding a new field instance; first is true if this is the first time this field name was seen in the document.
      • newTerm

        abstract void newTerm​(int termID)
                       throws java.io.IOException
        Called when a term is seen for the first time.
        Throws:
        java.io.IOException
      • addTerm

        abstract void addTerm​(int termID)
                       throws java.io.IOException
        Called when a previously seen term is seen again.
        Throws:
        java.io.IOException
      • newPostingsArray

        abstract void newPostingsArray()
        Called when the postings array is initialized or resized.
      • createPostingsArray

        abstract ParallelPostingsArray createPostingsArray​(int size)
        Creates a new postings array of the specified size.