Class: OpenSearch::DSL::Search::Aggregations::Range
- Inherits:
-
Object
- Object
- OpenSearch::DSL::Search::Aggregations::Range
- Includes:
- BaseAggregationComponent
- Defined in:
- lib/opensearch/dsl/search/aggregations/range.rb
Overview
A multi-bucket aggregation which returns document counts for custom numerical ranges, which define the buckets
Instance Method Summary collapse
Methods included from BaseAggregationComponent
Instance Method Details
#key(key, value) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/opensearch/dsl/search/aggregations/range.rb', line 67 def key(key, value) @hash[name].update(@args) if @args @hash[name][:keyed] = true unless @hash[name].has_key?(:keyed) @hash[name][:ranges] ||= [] @hash[name][:ranges] << value.merge(key: key) unless @hash[name][:ranges].any? { |i| i[:key] == key } self end |