Class XNumericComparator.NumericLeafComparator

java.lang.Object
org.elasticsearch.lucene.comparators.XNumericComparator.NumericLeafComparator
All Implemented Interfaces:
org.apache.lucene.search.LeafFieldComparator
Direct Known Subclasses:
XLongComparator.LongLeafComparator
Enclosing class:
XNumericComparator<T extends Number>

public abstract class XNumericComparator.NumericLeafComparator extends Object implements org.apache.lucene.search.LeafFieldComparator
Leaf comparator for NumericComparator that provides skipping functionality
  • Field Details

    • docValues

      protected final org.apache.lucene.index.NumericDocValues docValues
  • Constructor Details

    • NumericLeafComparator

      public NumericLeafComparator(org.apache.lucene.index.LeafReaderContext context) throws IOException
      Throws:
      IOException
  • Method Details

    • buildCompetitiveDISIBuilder

      protected XNumericComparator<T>.CompetitiveDISIBuilder buildCompetitiveDISIBuilder(org.apache.lucene.index.LeafReaderContext context) throws IOException
      Throws:
      IOException
    • getNumericDocValues

      protected org.apache.lucene.index.NumericDocValues getNumericDocValues(org.apache.lucene.index.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
    • setBottom

      public void setBottom(int slot) throws IOException
      Specified by:
      setBottom in interface org.apache.lucene.search.LeafFieldComparator
      Throws:
      IOException
    • copy

      public void copy(int slot, int doc) throws IOException
      Specified by:
      copy in interface org.apache.lucene.search.LeafFieldComparator
      Throws:
      IOException
    • setScorer

      public void setScorer(org.apache.lucene.search.Scorable scorer) throws IOException
      Specified by:
      setScorer in interface org.apache.lucene.search.LeafFieldComparator
      Throws:
      IOException
    • setHitsThresholdReached

      public void setHitsThresholdReached() throws IOException
      Specified by:
      setHitsThresholdReached in interface org.apache.lucene.search.LeafFieldComparator
      Throws:
      IOException
    • competitiveIterator

      public org.apache.lucene.search.DocIdSetIterator competitiveIterator()
      Specified by:
      competitiveIterator in interface org.apache.lucene.search.LeafFieldComparator
    • bottomAsComparableLong

      protected abstract long bottomAsComparableLong()
    • topAsComparableLong

      protected abstract long topAsComparableLong()