Module org.elasticsearch.server
Class XNumericComparator<T extends Number>
java.lang.Object
org.apache.lucene.search.FieldComparator<T>
org.elasticsearch.lucene.comparators.XNumericComparator<T>
- Direct Known Subclasses:
XLongComparator
public abstract class XNumericComparator<T extends Number>
extends org.apache.lucene.search.FieldComparator<T>
Abstract numeric comparator for comparing numeric values. This comparator provides a skipping
functionality – an iterator that can skip over non-competitive documents.
Parameter field provided in the constructor is used as a field name in the default
implementations of the methods getNumericDocValues and getPointValues to retrieve
doc values and points. You can pass a dummy value for a field name (e.g. when sorting by script),
but in this case you must override both of these methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classclassLeaf comparator forNumericComparatorthat provides skipping functionalityNested classes/interfaces inherited from class org.apache.lucene.search.FieldComparator
org.apache.lucene.search.FieldComparator.RelevanceComparator, org.apache.lucene.search.FieldComparator.TermValComparator -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedXNumericComparator(String field, T missingValue, boolean reverse, org.apache.lucene.search.Pruning pruning, int bytesCount) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected abstract longvoidvoidsetTopValue(T value) protected abstract longsortableBytesToLong(byte[] bytes) Decode sortable bytes to long.Methods inherited from class org.apache.lucene.search.FieldComparator
compare, compareValues, getLeafComparator, value
-
Field Details
-
missingValue
-
field
-
reverse
protected final boolean reverse -
topValueSet
protected boolean topValueSet -
singleSort
protected boolean singleSort -
hitsThresholdReached
protected boolean hitsThresholdReached -
queueFull
protected boolean queueFull -
pruning
protected org.apache.lucene.search.Pruning pruning
-
-
Constructor Details
-
XNumericComparator
-
-
Method Details
-
setTopValue
-
setSingleSort
public void setSingleSort() -
disableSkipping
public void disableSkipping() -
missingValueAsComparableLong
protected abstract long missingValueAsComparableLong() -
sortableBytesToLong
protected abstract long sortableBytesToLong(byte[] bytes) Decode sortable bytes to long. It should be consistent with the codec thatPointValuesof this field is using.
-