June 2017
Beginner to intermediate
404 pages
8h 22m
English
Elasticsearch aggregations are calendar aware, which makes working with dates very simple. Let's start with range aggregation. Just like we used filter aggregations to define buckets based on filters, we can use date range aggregation to define buckets based on date ranges. The advantage of using date range aggregation is that it is calendar aware and can understand date math (1M, 1h, 1Y).
For example, suppose we want to group all the products based on the product release date. The example used in filter aggregation can be rewritten using range aggregation as shown here:
#Date RangePOST chapter8/_search { "aggs": { "range": { "date_range": { "field": "release_date", "ranges": [ { "from": "2016-01-01", ...Read now
Unlock full access