Class: ElasticsearchDslBuilder::DSL::Search::Aggregations::Nested
- Inherits:
-
Aggregation
- Object
- Aggregation
- ElasticsearchDslBuilder::DSL::Search::Aggregations::Nested
- Defined in:
- lib/elasticsearch_dsl_builder/dsl/search/aggregations/nested.rb
Instance Method Summary collapse
-
#initialize(path = nil) ⇒ Nested
constructor
A new instance of Nested.
- #path(path) ⇒ Object
- #to_hash ⇒ Object
Methods inherited from Aggregation
Constructor Details
#initialize(path = nil) ⇒ Nested
Returns a new instance of Nested.
6 7 8 9 10 |
# File 'lib/elasticsearch_dsl_builder/dsl/search/aggregations/nested.rb', line 6 def initialize(path = nil) @type = :nested path(path) super() end |
Instance Method Details
#path(path) ⇒ Object
12 13 14 15 16 |
# File 'lib/elasticsearch_dsl_builder/dsl/search/aggregations/nested.rb', line 12 def path(path) raise ArgumentError, 'path must be a String' unless path.instance_of?(String) @path = path self end |
#to_hash ⇒ Object
18 19 20 21 |
# File 'lib/elasticsearch_dsl_builder/dsl/search/aggregations/nested.rb', line 18 def to_hash @aggregation = { path: @path } super end |