Min_bucket

Min bucket aggregation

/ Min_bucket, / Aggregation

Min bucket aggregation #

A sibling pipeline aggregation identifying the smallest per-bucket metric value. Bucket aggregations rank groups by their own key or doc_count; min_bucket answers the orthogonal question — which of the per-bucket numbers (a revenue, a latency, a rate) is the lowest, and how low.

"worst_seller": { "min_bucket": { "buckets_path": "per_type>revenue" } }

How it works #

min_bucket is declared next to the bucket aggregation it consumes and runs after every regular aggregation — including the distributed merge — has finished. It walks the parent’s finished buckets, collects one number per bucket, and returns their minimum as a single-value metric ({"value": 1350}) placed alongside the parent. Only the value is returned — not which bucket produced it; read the parent’s bucket list when you need the winner’s key.

...