> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-dx-2659.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

Bucket aggregations group matching documents into buckets.

Use bucket aggregations when you want segmented analytics (for example by category, price tier, or time window).

### Available Operators

| Operator                             | What it groups by             |
| ------------------------------------ | ----------------------------- |
| [`$terms`](./terms)                  | Distinct field values         |
| [`$range`](./range)                  | Explicit `from` / `to` ranges |
| [`$histogram`](./histogram)          | Fixed numeric intervals       |
| [`$dateHistogram`](./date-histogram) | Fixed date/time intervals     |
| [`$facet`](./facet)                  | Hierarchical FACET paths      |

### Behavior Notes

* Bucket operators can contain nested `$aggs`.
* `$terms`, `$range`, `$histogram`, and `$dateHistogram` support nested `$aggs`.
* `$facet` does not support nested `$aggs` and cannot be used as a sub-aggregation.
