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.

        Parameters:
        context - – reader context
        field - - field name
        Returns:
        numeric doc values for the field in this segment.
        Throws:
        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
        Parameters:
        slot - which slot to copy the hit to
        doc - docID relative to current reader
        Throws:
        IOException
      • competitiveIterator

        public DocIdSetIterator competitiveIterator()
        Description copied from interface: LeafFieldComparator
        Returns a competitive iterator
        Specified by:
        competitiveIterator in interface LeafFieldComparator
        Returns:
        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.
      • isMissingValueCompetitive

        protected abstract boolean isMissingValueCompetitive()
      • encodeBottom

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

        protected abstract void encodeTop​(byte[] packedValue)