Class ValuesSource.Numeric
- Direct Known Subclasses:
CellIdSource,ValuesSource.Numeric.FieldData,ValuesSource.Numeric.Script,ValuesSource.Numeric.WithScript
- Enclosing class:
- ValuesSource
public abstract static class ValuesSource.Numeric extends ValuesSource
values or on 64 bit signed two's complement
values. They'll do normal "number stuff"
to those values like add, multiply, and compare them to other numbers.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValuesSource.Numeric.FieldDatastatic classValuesSource.Numeric.ScriptValuesSourceimplementation for stand alone scripts returning a Numeric valuestatic classValuesSource.Numeric.WithScriptValuesSourcesubclass for Numeric fields with a Value Script appliedNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.support.ValuesSource
ValuesSource.Bytes, ValuesSource.GeoPoint, ValuesSource.Numeric, ValuesSource.Range -
Field Summary
Fields Modifier and Type Field Description static ValuesSource.NumericEMPTY -
Constructor Summary
Constructors Constructor Description Numeric() -
Method Summary
Modifier and Type Method Description DocValueBitsdocsWithValue(org.apache.lucene.index.LeafReaderContext context)Get a "has any values" view into the values.abstract SortedNumericDoubleValuesdoubleValues(org.apache.lucene.index.LeafReaderContext context)Get a double precision floating point view into the values in this leaf.abstract booleanisFloatingPoint()Are values of this field better represented as a double precision floating point numbers (true) or 64 bit signed numbers (false)?abstract org.apache.lucene.index.SortedNumericDocValueslongValues(org.apache.lucene.index.LeafReaderContext context)Get a 64 bit signed view into the values in this leaf.java.util.function.Function<Rounding,Rounding.Prepared>roundingPreparer()Build a function to prepareRoundings.Methods inherited from class org.elasticsearch.search.aggregations.support.ValuesSource
bytesValues, hasOrdinals, needsScoresMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
EMPTY
-
-
Constructor Details
-
Numeric
public Numeric()
-
-
Method Details
-
isFloatingPoint
public abstract boolean isFloatingPoint()Are values of this field better represented as a double precision floating point numbers (true) or 64 bit signed numbers (false)?Aggregations may, if they feel it is important, use this to pick which of
longValues(org.apache.lucene.index.LeafReaderContext)anddoubleValues(org.apache.lucene.index.LeafReaderContext)is better for the field values. Most metric aggregations are quite happy to operate on floating point numbers all the time and never call this. Bucketing aggregations that want to enumerate all values (likeTermsAggregator) will want to check this but bucketing aggregations that just compare values (RangeAggregator) are, like metric aggregators, fine ignoring it. -
longValues
public abstract org.apache.lucene.index.SortedNumericDocValues longValues(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOExceptionGet a 64 bit signed view into the values in this leaf.If the values have precision beyond the decimal point then they'll be "narrowed" but they'll accurately represent values up to
Long.MAX_VALUE.- Throws:
java.io.IOException
-
doubleValues
public abstract SortedNumericDoubleValues doubleValues(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOExceptionGet a double precision floating point view into the values in this leaf.These values will preserve any precision beyond the decimal point but are limited to
double's standard 53 bit mantissa. If the "native" field has values that can't be accurately represented in those 53 bits they'll be "widened"- Throws:
java.io.IOException
-
docsWithValue
public DocValueBits docsWithValue(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOExceptionDescription copied from class:ValuesSourceGet a "has any values" view into the values. It'll try to pick the "most native" way to check if there are any values, but it builds its own view into the values so if you need any of the actual values its best to use something likeValuesSource.bytesValues(org.apache.lucene.index.LeafReaderContext)ordoubleValues(org.apache.lucene.index.LeafReaderContext)but if you just need to know if there are any values then use this.- Specified by:
docsWithValuein classValuesSource- Throws:
java.io.IOException
-
roundingPreparer
public java.util.function.Function<Rounding,Rounding.Prepared> roundingPreparer() throws java.io.IOExceptionDescription copied from class:ValuesSourceBuild a function to prepareRoundings.This returns a Function because auto date histogram will need to call it many times over the course of running the aggregation. Other aggregations should feel free to call it once.
- Specified by:
roundingPreparerin classValuesSource- Throws:
java.io.IOException
-