Class IndexFieldData.XFieldComparatorSource
java.lang.Object
org.apache.lucene.search.FieldComparatorSource
org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource
- Direct Known Subclasses:
BytesRefFieldComparatorSource
,DoubleValuesComparatorSource
,FloatValuesComparatorSource
,LongValuesComparatorSource
- Enclosing interface:
- IndexFieldData<FD extends LeafFieldData>
public abstract static class IndexFieldData.XFieldComparatorSource
extends org.apache.lucene.search.FieldComparatorSource
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexFieldData.XFieldComparatorSource.Nested
Simple wrapper class around a filter that matches parent documents and a filter that matches child documents. -
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
missingValue
protected IndexFieldData.XFieldComparatorSource.Nested
nested
protected MultiValueMode
sortMode
-
Constructor Summary
Constructors Constructor Description XFieldComparatorSource(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested)
-
Method Summary
Modifier and Type Method Description java.lang.Object
missingObject(java.lang.Object missingValue, boolean reversed)
Return the missing object value according to the reduced type of the comparator.java.lang.Object
missingValue(boolean reversed)
Return a missing value that is understandable bySortField.setMissingValue(Object)
.IndexFieldData.XFieldComparatorSource.Nested
nested()
abstract BucketedSort
newBucketedSort(BigArrays bigArrays, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra)
Create a BucketedSort which is useful for sorting inside of aggregations.abstract org.apache.lucene.search.SortField.Type
reducedType()
boolean
sortMissingFirst(java.lang.Object missingValue)
Whether missing values should be sorted first.boolean
sortMissingLast(java.lang.Object missingValue)
Whether missing values should be sorted last, this is the default.MultiValueMode
sortMode()
Methods inherited from class org.apache.lucene.search.FieldComparatorSource
newComparator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
sortMode
-
missingValue
protected final java.lang.Object missingValue -
nested
-
-
Constructor Details
-
XFieldComparatorSource
public XFieldComparatorSource(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested)
-
-
Method Details
-
sortMode
-
nested
-
sortMissingFirst
public final boolean sortMissingFirst(java.lang.Object missingValue)Whether missing values should be sorted first. -
sortMissingLast
public final boolean sortMissingLast(java.lang.Object missingValue)Whether missing values should be sorted last, this is the default. -
missingObject
public final java.lang.Object missingObject(java.lang.Object missingValue, boolean reversed)Return the missing object value according to the reduced type of the comparator. -
reducedType
public abstract org.apache.lucene.search.SortField.Type reducedType() -
missingValue
public java.lang.Object missingValue(boolean reversed)Return a missing value that is understandable bySortField.setMissingValue(Object)
. Most implementations return null because they already replace the value at the fielddata level. However this can't work in case of strings since there is no such thing as a string which compares greater than any other string, so in that case we need to returnSortField.STRING_FIRST
orSortField.STRING_LAST
so that the coordinating node knows how to deal with null values. -
newBucketedSort
public abstract BucketedSort newBucketedSort(BigArrays bigArrays, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra)Create a BucketedSort which is useful for sorting inside of aggregations.
-