Class ValuesSource.Numeric.Script

java.lang.Object
Enclosing class:
ValuesSource.Numeric

public static class ValuesSource.Numeric.Script
extends ValuesSource.Numeric
ValuesSource implementation for stand alone scripts returning a Numeric value
  • Constructor Details

  • Method Details

    • isFloatingPoint

      public boolean isFloatingPoint()
      Description copied from class: ValuesSource.Numeric
      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 ValuesSource.Numeric.longValues(org.apache.lucene.index.LeafReaderContext) and ValuesSource.Numeric.doubleValues(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 (like TermsAggregator) will want to check this but bucketing aggregations that just compare values (RangeAggregator) are, like metric aggregators, fine ignoring it.

      Specified by:
      isFloatingPoint in class ValuesSource.Numeric
    • longValues

      public org.apache.lucene.index.SortedNumericDocValues longValues​(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOException
      Description copied from class: ValuesSource.Numeric
      Get 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.

      Specified by:
      longValues in class ValuesSource.Numeric
      Throws:
      java.io.IOException
    • doubleValues

      public SortedNumericDoubleValues doubleValues​(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOException
      Description copied from class: ValuesSource.Numeric
      Get 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"

      Specified by:
      doubleValues in class ValuesSource.Numeric
      Throws:
      java.io.IOException
    • bytesValues

      public SortedBinaryDocValues bytesValues​(org.apache.lucene.index.LeafReaderContext context) throws java.io.IOException
      Description copied from class: ValuesSource
      Get a byte array like view into the values. This is the "native" way to access ValuesSource.Bytes-style values.
      Specified by:
      bytesValues in class ValuesSource
      Throws:
      java.io.IOException
    • needsScores

      public boolean needsScores()
      Description copied from class: ValuesSource
      Whether this values source needs scores.
      Overrides:
      needsScores in class ValuesSource