Class ScriptedMetricAggregation

java.lang.Object
co.elastic.clients.elasticsearch._types.aggregations.MetricAggregationBase
co.elastic.clients.elasticsearch._types.aggregations.ScriptedMetricAggregation
All Implemented Interfaces:
AggregationVariant, JsonpSerializable

@JsonpDeserializable public class ScriptedMetricAggregation extends MetricAggregationBase implements AggregationVariant
See Also:
  • Field Details

  • Method Details

    • of

    • _aggregationKind

      public Aggregation.Kind _aggregationKind()
      Aggregation variant kind.
      Specified by:
      _aggregationKind in interface AggregationVariant
    • combineScript

      @Nullable public final Script combineScript()
      Runs once on each shard after document collection is complete. Allows the aggregation to consolidate the state returned from each shard.

      API name: combine_script

    • initScript

      @Nullable public final Script initScript()
      Runs prior to any collection of documents. Allows the aggregation to set up any initial state.

      API name: init_script

    • mapScript

      @Nullable public final Script mapScript()
      Run once per document collected. If no combine_script is specified, the resulting state needs to be stored in the state object.

      API name: map_script

    • params

      public final Map<String,JsonData> params()
      A global object with script parameters for init, map and combine scripts. It is shared between the scripts.

      API name: params

    • reduceScript

      @Nullable public final Script reduceScript()
      Runs once on the coordinating node after all shards have returned their results. The script is provided with access to a variable states, which is an array of the result of the combine_script on each shard.

      API name: reduce_script

    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Overrides:
      serializeInternal in class MetricAggregationBase
    • setupScriptedMetricAggregationDeserializer

      protected static void setupScriptedMetricAggregationDeserializer(ObjectDeserializer<ScriptedMetricAggregation.Builder> op)