Class: Aggregations::Metrics::AvgAggregationBuilder

Inherits:
Object
  • Object
show all
Includes:
Helpers::AbstractAggregationHelper, Helpers::AggregationQueryBuilderHelper, Helpers::ValuesSourceAggregationHelper, AttributesReader
Defined in:
lib/aggregations/metrics/avg_aggregation_builder.rb

Overview

Elasticsearch Avg Aggregation

Constant Summary

Constants included from Helpers::AggregationQueryBuilderHelper

Helpers::AggregationQueryBuilderHelper::OBJECT_ARRAY_QUERY_FIELDS, Helpers::AggregationQueryBuilderHelper::OBJECT_ARRAY_SETTINGS_FIELDS

Instance Method Summary collapse

Methods included from AttributesReader

#attributes

Methods included from Helpers::AggregationQueryBuilderHelper

#name_expr, #query, #type_expr

Methods included from Helpers::AbstractAggregationHelper

#abstract_agg_builder, #sub_aggregation, #sub_aggregation_expr

Methods included from Helpers::ValuesSourceAggregationHelper

#field, #field_expr, #missing, #missing_expr, #script, #script_expr, #value_source_agg_builder

Constructor Details

#initialize(name:) ⇒ AvgAggregationBuilder

Returns a new instance of AvgAggregationBuilder.

Parameters:

  • name (String)

    : Aggregation name



12
13
14
15
16
17
18
19
20
# File 'lib/aggregations/metrics/avg_aggregation_builder.rb', line 12

def initialize name:
  @name = name.intern
  @type = :avg
  @query = {
    @name => {
      @type => {}
    }
  }
end