Search in sources :

Example 1 with AvgAggregationBuilder

use of org.graylog.shaded.elasticsearch7.org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder in project graylog2-server by Graylog2.

the class ESAverageHandler method doCreateAggregation.

@Nonnull
@Override
public Optional<AggregationBuilder> doCreateAggregation(String name, Pivot pivot, Average avgSpec, ESPivot searchTypeHandler, ESGeneratedQueryContext queryContext) {
    final AvgAggregationBuilder avg = AggregationBuilders.avg(name).field(avgSpec.field());
    record(queryContext, pivot, avgSpec, name, Avg.class);
    return Optional.of(avg);
}
Also used : AvgAggregationBuilder(org.graylog.shaded.elasticsearch7.org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder) Nonnull(javax.annotation.Nonnull)

Aggregations

Nonnull (javax.annotation.Nonnull)1 AvgAggregationBuilder (org.graylog.shaded.elasticsearch7.org.elasticsearch.search.aggregations.metrics.AvgAggregationBuilder)1