Module: Aggregations::Helpers::AbstractAggregationHelper
- Included in:
- Buckets::DateHistogramAggregationBuilder, Buckets::DateRangeAggregationBuilder, Buckets::FilterAggregationBuilder, Buckets::FiltersAggregationBuilder, Buckets::GeoGridAggregationBuilder, Buckets::HistogramAggregationBuilder, Buckets::NestedAggregationBuilder, Buckets::RangeAggregationBuilder, Buckets::ReverseNestedAggregationBuilder, Buckets::TermsAggregationBuilder, Buckets::TopHitsAggregationBuilder, Metrics::AvgAggregationBuilder, Metrics::MaxAggregationBuilder, Metrics::MinAggregationBuilder
- Defined in:
- lib/aggregations/helpers/abstract_aggregation_helper.rb
Overview
A helper module for aggregations, defines sub aggregation attributes.
Instance Method Summary collapse
-
#abstract_agg_builder ⇒ Object
helper method to add abstract aggregation attributes to aggregation.
-
#sub_aggregation(sub_agg) ⇒ AbstractAggregationHelper
: aggregation object.
-
#sub_aggregation_expr ⇒ AbstractAggregationHelper
: aggregation object.
Instance Method Details
#abstract_agg_builder ⇒ Object
helper method to add abstract aggregation attributes to aggregation.
8 9 10 11 12 |
# File 'lib/aggregations/helpers/abstract_aggregation_helper.rb', line 8 def abstract_agg_builder builder = {} builder[:aggs] = build_sub_aggs_struct if @sub_aggregations.present? builder end |
#sub_aggregation(sub_agg) ⇒ AbstractAggregationHelper
Returns : aggregation object.
16 17 18 19 20 |
# File 'lib/aggregations/helpers/abstract_aggregation_helper.rb', line 16 def sub_aggregation(sub_agg) @sub_aggregations = [] if @sub_aggregations.nil? @sub_aggregations = @sub_aggregations.append(sub_agg) self end |
#sub_aggregation_expr ⇒ AbstractAggregationHelper
Returns : aggregation object.
23 24 25 |
# File 'lib/aggregations/helpers/abstract_aggregation_helper.rb', line 23 def sub_aggregation_expr @sub_aggregations end |