Class: Aggregations::Buckets::NestedAggregationBuilder

Inherits:
Object
  • Object
show all
Includes:
Helpers::AbstractAggregationHelper, Helpers::AggregationQueryBuilderHelper, AttributesReader
Defined in:
lib/aggregations/buckets/nested_aggregation_builder.rb

Overview

Elasticsearch Nested 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

Constructor Details

#initialize(name:, path:) ⇒ NestedAggregationBuilder

Returns a new instance of NestedAggregationBuilder.

Parameters:

  • name (String)

    : Aggregation name

  • path (String)


12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/aggregations/buckets/nested_aggregation_builder.rb', line 12

def initialize name:, path:
  @name = name.intern
  @type = :nested
  @path = path
  @query = {
    @name => {
      @type => {
        :path => path
      }
    }
  }
end

Instance Method Details

#path_exprString

Returns:

  • (String)


26
27
28
# File 'lib/aggregations/buckets/nested_aggregation_builder.rb', line 26

def path_expr
  @path
end