Class: Elasticsearch::DSL::Search::Aggregations::Range
- Inherits:
-
Object
- Object
- Elasticsearch::DSL::Search::Aggregations::Range
- Includes:
- BaseAggregationComponent
- Defined in:
- lib/elasticsearch/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
59 60 61 62 63 64 65 |
# File 'lib/elasticsearch/dsl/search/aggregations/range.rb', line 59 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 |