Class: JayAPI::Elasticsearch::QueryBuilder::Aggregations::ValueCount
- Inherits:
-
Aggregation
- Object
- Aggregation
- JayAPI::Elasticsearch::QueryBuilder::Aggregations::ValueCount
- Defined in:
- lib/jay_api/elasticsearch/query_builder/aggregations/value_count.rb
Overview
Represents a value_count
aggregation in Elasticsearch. Information about this type of aggregation can be found in: www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html
Instance Attribute Summary collapse
-
#field ⇒ Object
readonly
TODO: Add script support to the aggregation.
Attributes inherited from Aggregation
Instance Method Summary collapse
- #aggs ⇒ Object
-
#clone ⇒ self
A copy of the receiver.
-
#initialize(name, field:) ⇒ ValueCount
constructor
A new instance of ValueCount.
-
#to_h ⇒ Hash
The Hash representation of the
Aggregation
.
Constructor Details
#initialize(name, field:) ⇒ ValueCount
Returns a new instance of ValueCount.
18 19 20 21 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/value_count.rb', line 18 def initialize(name, field:) @field = field super(name) end |
Instance Attribute Details
#field ⇒ Object (readonly)
TODO: Add script support to the aggregation
15 16 17 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/value_count.rb', line 15 def field @field end |
Instance Method Details
#aggs ⇒ Object
26 27 28 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/value_count.rb', line 26 def aggs no_nested_aggregations('Value Count') end |
#clone ⇒ self
Returns A copy of the receiver.
31 32 33 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/value_count.rb', line 31 def clone self.class.new(name, field: field) end |
#to_h ⇒ Hash
Returns The Hash representation of the Aggregation
. Properly formatted for Elasticsearch.
37 38 39 40 41 42 43 44 45 |
# File 'lib/jay_api/elasticsearch/query_builder/aggregations/value_count.rb', line 37 def to_h super do { value_count: { field: field } } end end |