Class: Arelastic::Aggregations::Bucket
- Inherits:
-
Aggregation
- Object
- Nodes::Node
- Aggregation
- Arelastic::Aggregations::Bucket
- Defined in:
- lib/arelastic/aggregations/bucket.rb
Direct Known Subclasses
DateHistogram, Filter, Filters, Histogram, Missing, Range, ReverseNested, Sampler, SpecialSingleBucket, Terms
Instance Attribute Summary collapse
-
#aggs ⇒ Object
Returns the value of attribute aggs.
Attributes inherited from Aggregation
Instance Method Summary collapse
- #as_elastic_aggregation ⇒ Object
-
#initialize(name, options = {}) ⇒ Bucket
constructor
A new instance of Bucket.
Methods inherited from Aggregation
#as_elastic, #nested, #reverse_nested
Methods inherited from Nodes::Node
#==, #convert_to_elastic, #hash, #read_option!
Methods included from Arelastic::Arities::Binary
Methods included from Arelastic::Arities::Polyadic
Methods included from Arelastic::Arities::Unary
Constructor Details
#initialize(name, options = {}) ⇒ Bucket
Returns a new instance of Bucket.
6 7 8 9 10 |
# File 'lib/arelastic/aggregations/bucket.rb', line 6 def initialize(name, = {}) = .dup @aggs = read_option! , 'aggs' super(name, ) end |
Instance Attribute Details
#aggs ⇒ Object
Returns the value of attribute aggs.
4 5 6 |
# File 'lib/arelastic/aggregations/bucket.rb', line 4 def aggs @aggs end |
Instance Method Details
#as_elastic_aggregation ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/arelastic/aggregations/bucket.rb', line 12 def as_elastic_aggregation if aggs {'aggs' => Arelastic::Nodes::HashGroup.new(aggs).as_elastic} else {} end end |