Class: Elasticsearch::DSL::Search::Aggregations::DateRange

Inherits:
Object
  • Object
show all
Includes:
BaseAggregationComponent
Defined in:
lib/elasticsearch/dsl/search/aggregations/date_range.rb

Overview

A multi-bucket aggregation which returns document counts for custom date ranges

Examples:


search do
  aggregation :compare_to_last_year do
    date_range do
      field    'published_at'
      ranges [
        { from: 'now-1M/M', to: 'now/M' },
        { from: 'now-13M/M', to: 'now-12M/M' }
      ]
    end
  end
end

See Also:

Method Summary

Methods included from BaseAggregationComponent

included