Class: JayAPI::Elasticsearch::QueryBuilder::Aggregations::Max
- Inherits:
-
Aggregation
- Object
- Aggregation
- JayAPI::Elasticsearch::QueryBuilder::Aggregations::Max
- Defined in:
- lib/jay_api/elasticsearch/query_builder/aggregations/max.rb
Overview
Represents a max
aggregation in Elasticsearch. Information on this type of aggregation can be found here: www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-max-aggregation.html
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#missing ⇒ Object
readonly
Returns the value of attribute missing.
Attributes inherited from Aggregation
Instance Method Summary collapse
- #aggs ⇒ Object
-
#clone ⇒ self
A copy of the receiver.
-
#initialize(name, field:) ⇒ Max
constructor
A new instance of Max.
-
#to_h ⇒ Hash
The Hash representation of the
Aggregation
.
Constructor Details
#initialize(name, field:) ⇒ Max
Returns a new instance of Max.
18 19 20 21 22 23 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/max.rb', line 18 def initialize(name, field:) super(name) @field = field @missing = missing end |
Instance Attribute Details
#field ⇒ Object (readonly)
Returns the value of attribute field.
13 14 15 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/max.rb', line 13 def field @field end |
#missing ⇒ Object (readonly)
Returns the value of attribute missing.
13 14 15 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/max.rb', line 13 def missing @missing end |
Instance Method Details
#aggs ⇒ Object
27 28 29 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/max.rb', line 27 def aggs no_nested_aggregations('Max') end |
#clone ⇒ self
Returns A copy of the receiver.
32 33 34 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/max.rb', line 32 def clone self.class.new(name, field: field) end |
#to_h ⇒ Hash
Returns The Hash representation of the Aggregation
. Properly formatted for Elasticsearch.
38 39 40 41 42 43 44 45 46 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/max.rb', line 38 def to_h super do { max: { field: field } } end end |