Histogram aggregation
/ Histogram, / AggregationHistogram aggregation #
A multi-bucket aggregation over numeric fields that applies a fixed interval to build the buckets. It answers “how are the values distributed?” — every document lands in exactly one bucket, and the bucket keys form a regular grid over the value axis.
How it works #
Each document’s value v is placed by index arithmetic — bucket index
floor((v - offset) / interval) — so a bucket covers the half-open
window [key, key + interval). Buckets accumulate in a sorted map, and
the response lists them by ascending key.