August 2019
Intermediate to advanced
560 pages
13h 41m
English
The purpose of moving function aggregation is to execute a user-defined script with the values from the subset of buckets in a specified window size from the aggregation in the previous stage. The script parameter is used to specify the script to run and the window parameter is the size of the subset of buckets. The moving_fn aggregation must be processed with either the histogram or date_histogram aggregation. There are a few supported functions and we'll practice them in the following subsections. All functions are based on the common query and parent aggregation with a window size of 4 for the monthly closing price change from the buckets for the ACWF ETF in the cf_etf_hist_price index, as shown:
"query":{"match": ...Read now
Unlock full access