August 2019
Intermediate to advanced
560 pages
13h 41m
English
The purpose of the filter aggregation is to screen the documents that fit a specified filter and provide a total count. It generally acts as the pre-screening step to nail down the scope of documents:
"aggs":{"avg_changePercent_at_date": {"filter":{"term": {"date":"2019-02-15"}},"aggs": {"avg_changePercent": {"avg":{"field": "changePercent"}}}}}
"avg_changePercent_at_date": {"doc_count": 314,"avg_changePercent": {"value": .6038535040014299}}
Read now
Unlock full access