August 2019
Intermediate to advanced
560 pages
13h 41m
English
The purpose of the ranges aggregation is to group values into ranges and count the documents. Each range can be randomly defined by using the from/to keyword. Note that the from value is inclusive and the to value is exclusive:
"query": { "match": { "symbol": "ACWF"}},"aggs":{"monthly_trading_days": {"range":{"field": "date","format": "yyyy-MM-dd","ranges": [{"from":"2018-12-01"},{"to":"2019-04-01"},{"from":"2019-01-01","to":"2019-02-01"}]}
"monthly_trading_days": ...
Read now
Unlock full access