Date histogram aggregation
/ Date, / Histogram, / AggregationDate histogram aggregation #
This multi-bucket aggregation is similar to the normal histogram, but it can only be used with date fields. Dates are represented internally as epoch milliseconds, so the plain histogram can technically run on them too — but calendar intervals are not a fixed length (a month is 28–31 days), which is exactly what this aggregation handles.
How it works #
Date fields store epoch milliseconds at ingest, and the aggregation
builds its grid on those numbers. calendar_interval and
fixed_interval select between two grid types (exactly one must be
set):