August 2019
Intermediate to advanced
560 pages
13h 41m
English
The purpose of this is to perform a filter to select the buckets from the aggregation in the previous stage:
"query":{"match": {"symbol":"ACWF"}},"aggs":{"negative_monthly_change": {"date_histogram":{"field": "date","interval": "month","format": "yyyy-MM-dd"},"aggs":{"change_on_month":{ "sum":{"field":"change"}},"filter_positive_change_on_month":{"bucket_selector":{"buckets_path":{"monthly_change_value":"change_on_month"},"script":"params.monthly_change_value<0"}}}}
"negative_monthly_change": ...
Read now
Unlock full access