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 must also override getPointValues(LeafReaderContext, String) This class uses sort optimization that leverages points to filter out non-competitive matches, which relies on the assumption that points and doc values record the same information.

        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
      • getPointValues

        protected PointValues getPointValues​(LeafReaderContext context,
                                             String field)
                                      throws IOException
        Retrieves point values for the field in this segment

        If you override this method, you must also override getNumericDocValues(LeafReaderContext, String) This class uses sort optimization that leverages points to filter out non-competitive matches, which relies on the assumption that points and doc values record the same information. Return null even if no points implementation is available, in this case sort optimization with points will be disabled.

        Parameters:
        context - – reader context
        field - - field name
        Returns:
        point values for the field in this segment if they are available or null if sort optimization with points should be disabled.
        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)