date_histogram
The function date_histogram(str agg_name, str fieldname, str time_interval) a
lows to create histograms by date of the aggregation results.
The aggregation result will be stored under the key agg_name in results
. However, results will be segmented as a histogram with resolution according to time_interval
. The available units for time_interval
are s/m/h/d.
Example:
with date_histogram("agg_0", "fieldname1", "1d") as obj_0:
obj_0.aggregate_max("agg_max","fieldname1")
In this example, the aggregation results will be binned into a histogram where the width of each bin is 1d.
Last updated