Module org.elasticsearch.server
Class IndexNumericFieldData
java.lang.Object
org.elasticsearch.index.fielddata.IndexNumericFieldData
- All Implemented Interfaces:
IndexFieldData<LeafNumericFieldData>
- Direct Known Subclasses:
BooleanScriptFieldData,DateScriptFieldData,DoubleScriptFieldData,LongScriptFieldData,SortedDoublesIndexFieldData,SortedNumericIndexFieldData
public abstract class IndexNumericFieldData
extends Object
implements IndexFieldData<LeafNumericFieldData>
Base class for numeric field data.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe type of number.Nested classes/interfaces inherited from interface org.elasticsearch.index.fielddata.IndexFieldData
IndexFieldData.Builder, IndexFieldData.Global<FD extends LeafFieldData>, IndexFieldData.XFieldComparatorSource -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static SortedNumericLongValuesconvertNumeric(SortedNumericLongValues values, LongUnaryOperator converter) Convert the values indvsusing the providedconverter.protected IndexFieldData.XFieldComparatorSourcedateComparatorSource(Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested) protected IndexFieldData.XFieldComparatorSourcedateNanosComparatorSource(Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested) abstract IndexNumericFieldData.NumericTypeThe numeric type of this number.org.apache.lucene.search.SortFieldindexSort(IndexVersion indexCreatedVersion, Object missingValue, MultiValueMode sortMode, boolean reverse) protected abstract IndexTypeReturn true if, and only if the field is indexed with points that match the content of doc values.final BucketedSortnewBucketedSort(BigArrays bigArrays, Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) Build a sort implementation specialized for aggregations.final BucketedSortnewBucketedSort(IndexNumericFieldData.NumericType targetNumericType, BigArrays bigArrays, Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) Builds a BucketedSort for thetargetNumericType, casting the values if their native type doesn't match.final org.apache.lucene.search.SortFieldsortField(boolean indexSort, IndexNumericFieldData.NumericType targetNumericType, Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse) Returns theSortFieldto used for sorting.org.apache.lucene.search.SortFieldsortField(boolean indexSort, IndexVersion indexCreatedVersion, Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse) Returns theSortFieldto use for sorting depending on the version of the index.final org.apache.lucene.search.SortFieldsortField(Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse) Returns theSortFieldto use for sorting.protected abstract booleanShould sorting use a custom comparator source vs.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.index.fielddata.IndexFieldData
getFieldName, getValuesSourceType, load, loadDirect
-
Constructor Details
-
IndexNumericFieldData
public IndexNumericFieldData()
-
-
Method Details
-
getNumericType
The numeric type of this number. -
sortField
public final org.apache.lucene.search.SortField sortField(boolean indexSort, IndexNumericFieldData.NumericType targetNumericType, Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse) Returns theSortFieldto used for sorting. Values are casted to the providedtargetNumericTypetype if it doesn't match the field'snumericType. -
sortRequiresCustomComparator
protected abstract boolean sortRequiresCustomComparator()Should sorting use a custom comparator source vs. rely on a LuceneSortField. Using a LuceneSortFieldwhen possible is important because index sorting cannot be configured with a custom comparator, and because it gives better performance by dynamically pruning irrelevant hits. On the other hand, LuceneSortFields are less flexible and make stronger assumptions about how the data is indexed. Therefore, they cannot be used in all cases. -
indexType
Return true if, and only if the field is indexed with points that match the content of doc values. -
sortField
public final org.apache.lucene.search.SortField sortField(Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse) Description copied from interface:IndexFieldDataReturns theSortFieldto use for sorting.- Specified by:
sortFieldin interfaceIndexFieldData<LeafNumericFieldData>
-
indexSort
public org.apache.lucene.search.SortField indexSort(IndexVersion indexCreatedVersion, Object missingValue, MultiValueMode sortMode, boolean reverse) - Specified by:
indexSortin interfaceIndexFieldData<LeafNumericFieldData>
-
sortField
public org.apache.lucene.search.SortField sortField(boolean indexSort, IndexVersion indexCreatedVersion, Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse) Description copied from interface:IndexFieldDataReturns theSortFieldto use for sorting depending on the version of the index.- Specified by:
sortFieldin interfaceIndexFieldData<LeafNumericFieldData>
-
newBucketedSort
public final BucketedSort newBucketedSort(IndexNumericFieldData.NumericType targetNumericType, BigArrays bigArrays, @Nullable Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) Builds a BucketedSort for thetargetNumericType, casting the values if their native type doesn't match. -
newBucketedSort
public final BucketedSort newBucketedSort(BigArrays bigArrays, @Nullable Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra) Description copied from interface:IndexFieldDataBuild a sort implementation specialized for aggregations.- Specified by:
newBucketedSortin interfaceIndexFieldData<LeafNumericFieldData>
-
dateComparatorSource
protected IndexFieldData.XFieldComparatorSource dateComparatorSource(@Nullable Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested) -
dateNanosComparatorSource
protected IndexFieldData.XFieldComparatorSource dateNanosComparatorSource(@Nullable Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested) -
convertNumeric
protected static SortedNumericLongValues convertNumeric(SortedNumericLongValues values, LongUnaryOperator converter) Convert the values indvsusing the providedconverter.
-