Class NumericComparator.NumericLeafComparator

    • Method Detail

      • getNumericDocValues

        protected NumericDocValues getNumericDocValues​(LeafReaderContext context,
                                                       String field)
                                                throws IOException
        Retrieves the NumericDocValues for the field in this segment

        If you override this method, you should probably always disable skipping as the comparator uses values from the points index to build its competitive iterators, and assumes that the values in doc values and points are the same.

        context - – reader context
        field - - field name
        numeric doc values for the field in this segment.
        IOException - If there is a low-level I/O error
      • copy

        public void copy​(int slot,
                         int doc)
                  throws IOException
        Description copied from interface: LeafFieldComparator
        This method is called when a new hit is competitive. You should copy any state associated with this document that will be required for future comparisons, into the specified slot.
        Specified by:
        copy in interface LeafFieldComparator
        slot - which slot to copy the hit to
        doc - docID relative to current reader
      • competitiveIterator

        public DocIdSetIterator competitiveIterator()
        Description copied from interface: LeafFieldComparator
        Returns a competitive iterator
        Specified by:
        competitiveIterator in interface LeafFieldComparator
        an iterator over competitive docs that are stronger than already collected docs or null if such an iterator is not available for the current comparator or segment.
      • compareMissingValueWithTopValue

        protected abstract int compareMissingValueWithTopValue()
        in ascending sort, missing value is competitive when it is less or equal(maybe there are two or more comparators) than bottom value. if there is only one comparator(See Pruning.GREATER_THAN_OR_EQUAL_TO), missing value is competitive only when it is less than bottom value. vice versa in descending sort.
      • compareMissingValueWithBottomValue

        protected abstract int compareMissingValueWithBottomValue()
      • encodeBottom

        protected abstract void encodeBottom​(byte[] packedValue)
      • encodeTop

        protected abstract void encodeTop​(byte[] packedValue)