Class: Elastic::Nodes::Agg::Terms
- Includes:
- Concerns::Aggregable, Concerns::Bucketed
- Defined in:
- lib/elastic/nodes/agg/terms.rb
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#size ⇒ Object
Returns the value of attribute size.
Attributes inherited from BaseAgg
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Concerns::Bucketed
Methods included from Concerns::Aggregable
#aggregate, #aggregations, #aggregations=, #has_aggregations?, #traverse
Methods inherited from BaseAgg
Methods inherited from Base
#==, #handle_result, #traverse
Methods included from Support::Traversable
Constructor Details
This class inherits a constructor from Elastic::Nodes::BaseAgg
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
13 14 15 |
# File 'lib/elastic/nodes/agg/terms.rb', line 13 def field @field end |
#size ⇒ Object
Returns the value of attribute size.
13 14 15 |
# File 'lib/elastic/nodes/agg/terms.rb', line 13 def size @size end |
Class Method Details
.build(_name, _field, size: nil) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/elastic/nodes/agg/terms.rb', line 6 def self.build(_name, _field, size: nil) super(_name).tap do |node| node.field = _field node.size = size end end |
Instance Method Details
#clone ⇒ Object
15 16 17 |
# File 'lib/elastic/nodes/agg/terms.rb', line 15 def clone prepare_clone(super) end |
#render(_options = {}) ⇒ Object
23 24 25 26 27 28 |
# File 'lib/elastic/nodes/agg/terms.rb', line 23 def render( = {}) hash = { 'field' => @field.to_s } hash['size'] = @size if @size render_aggs({ 'terms' => hash }, ) end |
#simplify ⇒ Object
19 20 21 |
# File 'lib/elastic/nodes/agg/terms.rb', line 19 def simplify prepare_clone(super) end |