Package org.opensearch.index.fielddata
Class IndexFieldData.XFieldComparatorSource
java.lang.Object
org.apache.lucene.search.FieldComparatorSource
org.opensearch.index.fielddata.IndexFieldData.XFieldComparatorSource
- Direct Known Subclasses:
BytesRefFieldComparatorSource
,DoubleValuesComparatorSource
,FloatValuesComparatorSource
,IntValuesComparatorSource
,LongValuesComparatorSource
,UnsignedLongValuesComparatorSource
- Enclosing interface:
IndexFieldData<FD extends LeafFieldData>
public abstract static class IndexFieldData.XFieldComparatorSource
extends org.apache.lucene.search.FieldComparatorSource
we need this extended source we we have custom comparators to reuse our field data
in this case, we need to reduce type that will be used when search results are reduced
on another node (we don't have the custom source them...)
- Opensearch.internal:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Simple wrapper class around a filter that matches parent documents and a filter that matches child documents. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected final Object
protected final IndexFieldData.XFieldComparatorSource.Nested
protected final MultiValueMode
-
Constructor Summary
ConstructorsConstructorDescriptionXFieldComparatorSource
(Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested) -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected org.apache.lucene.search.Pruning
filterPruning
(org.apache.lucene.search.Pruning pruning) missingObject
(Object missingValue, boolean reversed) Return the missing object value according to the reduced type of the comparator.missingValue
(boolean reversed) Return a missing value that is understandable bySortField.setMissingValue(Object)
.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
final boolean
sortMissingFirst
(Object missingValue) Whether missing values should be sorted first.final boolean
sortMissingLast
(Object missingValue) Whether missing values should be sorted last, this is the default.sortMode()
Methods inherited from class org.apache.lucene.search.FieldComparatorSource
newComparator
-
Field Details
-
sortMode
-
missingValue
-
nested
-
enableSkipping
protected boolean enableSkipping
-
-
Constructor Details
-
XFieldComparatorSource
public XFieldComparatorSource(Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested)
-
-
Method Details
-
sortMode
-
nested
-
disableSkipping
public void disableSkipping() -
filterPruning
protected org.apache.lucene.search.Pruning filterPruning(org.apache.lucene.search.Pruning pruning) -
sortMissingFirst
Whether missing values should be sorted first. -
sortMissingLast
Whether missing values should be sorted last, this is the default. -
missingObject
Return the missing object value according to the reduced type of the comparator. -
reducedType
public abstract org.apache.lucene.search.SortField.Type reducedType() -
missingValue
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.
-