Module org.elasticsearch.server
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.lucene.index.NumericDocValues -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract longprotected XNumericComparator<T>.CompetitiveDISIBuilderbuildCompetitiveDISIBuilder(org.apache.lucene.index.LeafReaderContext context) org.apache.lucene.search.DocIdSetIteratorvoidcopy(int slot, int doc) protected org.apache.lucene.index.NumericDocValuesgetNumericDocValues(org.apache.lucene.index.LeafReaderContext context, String field) Retrieves the NumericDocValues for the field in this segmentvoidsetBottom(int slot) voidvoidsetScorer(org.apache.lucene.search.Scorable scorer) protected abstract longMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.search.LeafFieldComparator
compareBottom, compareTop
-
Field Details
-
docValues
protected final org.apache.lucene.index.NumericDocValues docValues
-
-
Constructor Details
-
NumericLeafComparator
- 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 segmentIf 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 contextfield- - field name- Returns:
- numeric doc values for the field in this segment.
- Throws:
IOException- If there is a low-level I/O error
-
setBottom
- Specified by:
setBottomin interfaceorg.apache.lucene.search.LeafFieldComparator- Throws:
IOException
-
copy
- Specified by:
copyin interfaceorg.apache.lucene.search.LeafFieldComparator- Throws:
IOException
-
setScorer
- Specified by:
setScorerin interfaceorg.apache.lucene.search.LeafFieldComparator- Throws:
IOException
-
setHitsThresholdReached
- Specified by:
setHitsThresholdReachedin interfaceorg.apache.lucene.search.LeafFieldComparator- Throws:
IOException
-
competitiveIterator
public org.apache.lucene.search.DocIdSetIterator competitiveIterator()- Specified by:
competitiveIteratorin interfaceorg.apache.lucene.search.LeafFieldComparator
-
bottomAsComparableLong
protected abstract long bottomAsComparableLong() -
topAsComparableLong
protected abstract long topAsComparableLong()
-