August 2019
Intermediate to advanced
560 pages
13h 41m
English
The purpose of this is to perform and process a user-defined script for each bucket from the aggregation in the previous stage. The script parameter lets us specify the contents of the script:
"query":{"match": {"symbol":"ACWF"}},"aggs":{"monthly_change": {"date_histogram":{"field": "date","interval": "month","format": "yyyy-MM-dd"},"aggs":{"change_on_month":{ "sum":{"field":"change"}},"min_change_on_month":{"min":{"field":"change"}},"max_change_on_month":{"max":{"field":"change"}},"range_of_change":{"bucket_script":{"buckets_path":{"min_value":"min_change_on_month", ...Read now
Unlock full access