Class TermsEnumIndex

  • Direct Known Subclasses:
    MultiTermsEnum.TermsEnumWithSlice

    class TermsEnumIndex
    extends java.lang.Object
    Wrapper around a TermsEnum and an integer that identifies it. All operations that move the current position of the TermsEnum must be performed via this wrapper class, not directly on the wrapped TermsEnum.
    • Field Detail

      • subIndex

        final int subIndex
      • currentTerm

        private BytesRef currentTerm
      • currentTermPrefix8

        private long currentTermPrefix8
    • Constructor Detail

      • TermsEnumIndex

        TermsEnumIndex​(TermsEnum termsEnum,
                       int subIndex)
    • Method Detail

      • prefix8ToComparableUnsignedLong

        static long prefix8ToComparableUnsignedLong​(BytesRef term)
        Copy the first 8 bytes of the given term as a comparable unsigned long. In case the term has less than 8 bytes, missing bytes will be replaced with zeroes. Note that two terms that produce the same long could still be different due to the fact that missing bytes are replaced with zeroes, e.g. [1, 0] and [1] get mapped to the same long.
      • setTerm

        private void setTerm​(BytesRef term)
      • next

        BytesRef next()
               throws java.io.IOException
        Throws:
        java.io.IOException
      • seekExact

        boolean seekExact​(BytesRef term)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • seekExact

        void seekExact​(long ord)
                throws java.io.IOException
        Throws:
        java.io.IOException
      • reset

        void reset​(TermsEnumIndex tei)
            throws java.io.IOException
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object