Class: JayAPI::Elasticsearch::QueryBuilder::Aggregations::Aggregation
- Inherits:
-
Object
- Object
- JayAPI::Elasticsearch::QueryBuilder::Aggregations::Aggregation
- Defined in:
- lib/jay_api/elasticsearch/query_builder/aggregations/aggregation.rb
Overview
Base class for all Elasticsearch aggregation types. For more information on what types of aggregations are available see: www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
Direct Known Subclasses
Avg, Cardinality, Composite, DateHistogram, Filter, Max, ScriptedMetric, Sum, Terms, TopHits, ValueCount
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#aggs {|The| ... } ⇒ JayAPI::Elasticsearch::QueryBuilder::Aggregations, self
Creates nested aggregations inside the receiver.
- #clone ⇒ Object
-
#initialize(name) ⇒ Aggregation
constructor
A new instance of Aggregation.
Constructor Details
#initialize(name) ⇒ Aggregation
Returns a new instance of Aggregation.
17 18 19 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/aggregation.rb', line 17 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/aggregation.rb', line 13 def name @name end |
Instance Method Details
#aggs {|The| ... } ⇒ JayAPI::Elasticsearch::QueryBuilder::Aggregations, self
Creates nested aggregations inside the receiver.
28 29 30 31 32 33 34 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/aggregation.rb', line 28 def aggs(&block) aggregations = self.aggregations ||= ::JayAPI::Elasticsearch::QueryBuilder::Aggregations.new return aggregations unless block block.call(aggregations) self end |
#clone ⇒ Object
38 39 40 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/aggregation.rb', line 38 def clone raise NotImplementedError, "Please implement #{__method__} in #{self.class}" end |