Class IndexNumericFieldData
java.lang.Object
org.elasticsearch.index.fielddata.IndexNumericFieldData
- All Implemented Interfaces:
IndexFieldData<LeafNumericFieldData>
- Direct Known Subclasses:
SortedNumericIndexFieldData
public abstract class IndexNumericFieldData extends java.lang.Object implements IndexFieldData<LeafNumericFieldData>
Base class for numeric field data.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexNumericFieldData.NumericType
The 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 Constructor Description IndexNumericFieldData()
-
Method Summary
Modifier and Type Method Description protected static org.apache.lucene.index.SortedNumericDocValues
convertNumeric(org.apache.lucene.index.SortedNumericDocValues values, java.util.function.LongUnaryOperator converter)
Convert the values indvs
using the providedconverter
.protected IndexFieldData.XFieldComparatorSource
dateComparatorSource(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested)
protected IndexFieldData.XFieldComparatorSource
dateNanosComparatorSource(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested)
abstract IndexNumericFieldData.NumericType
getNumericType()
The numeric type of this number.BucketedSort
newBucketedSort(BigArrays bigArrays, java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra)
Build a sort implementation specialized for aggregations.BucketedSort
newBucketedSort(IndexNumericFieldData.NumericType targetNumericType, BigArrays bigArrays, java.lang.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.org.apache.lucene.search.SortField
sortField(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)
Returns theSortField
to use for sorting.org.apache.lucene.search.SortField
sortField(IndexNumericFieldData.NumericType targetNumericType, java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)
Returns theSortField
to used for sorting.protected abstract boolean
sortRequiresCustomComparator()
DoessortField(org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType, java.lang.Object, org.elasticsearch.search.MultiValueMode, org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested, boolean)
require a custom comparator because of the way the data is stored in doc values (true
) or are the docs values stored such that they can be sorted without decoding (false
).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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(IndexNumericFieldData.NumericType targetNumericType, java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)Returns theSortField
to used for sorting. Values are casted to the providedtargetNumericType
type if it doesn't match the field'snumericType
. -
sortRequiresCustomComparator
protected abstract boolean sortRequiresCustomComparator()DoessortField(org.elasticsearch.index.fielddata.IndexNumericFieldData.NumericType, java.lang.Object, org.elasticsearch.search.MultiValueMode, org.elasticsearch.index.fielddata.IndexFieldData.XFieldComparatorSource.Nested, boolean)
require a custom comparator because of the way the data is stored in doc values (true
) or are the docs values stored such that they can be sorted without decoding (false
). -
sortField
public final org.apache.lucene.search.SortField sortField(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)Description copied from interface:IndexFieldData
Returns theSortField
to use for sorting.- Specified by:
sortField
in interfaceIndexFieldData<LeafNumericFieldData>
-
newBucketedSort
public final BucketedSort newBucketedSort(IndexNumericFieldData.NumericType targetNumericType, BigArrays bigArrays, @Nullable java.lang.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 java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra)Description copied from interface:IndexFieldData
Build a sort implementation specialized for aggregations.- Specified by:
newBucketedSort
in interfaceIndexFieldData<LeafNumericFieldData>
-
dateComparatorSource
protected IndexFieldData.XFieldComparatorSource dateComparatorSource(@Nullable java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested) -
dateNanosComparatorSource
protected IndexFieldData.XFieldComparatorSource dateNanosComparatorSource(@Nullable java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested) -
convertNumeric
protected static org.apache.lucene.index.SortedNumericDocValues convertNumeric(org.apache.lucene.index.SortedNumericDocValues values, java.util.function.LongUnaryOperator converter)Convert the values indvs
using the providedconverter
.
-