$histogram groups numeric values into fixed-width interval buckets.
Use it for distribution charts when each bucket has the same width.
Compatibility
| Field Type | Supported |
|---|---|
| TEXT | No |
| U64/I64/F64 | Yes |
| DATE | Yes |
| BOOL | No |
| KEYWORD | No |
| FACET | No |
FAST.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
field | string | Yes | Field to bucket on. |
interval | number | Yes | Bucket width. |
offset | number | No | Shift bucket boundaries. |
minDocCount | number | No | Exclude buckets with fewer docs. |
hardBounds | { min: number, max: number } | No | Hard clamp for bucket range. |
extendedBounds | { min: number, max: number } | No | Emit buckets across this range, including empty ones. |
keyed | boolean | No | If true, returns buckets as an object. Default: false. |
hardBounds and extendedBounds, both min and max are required.
- TypeScript
- Python
- Redis CLI
Output
keyAsString and nested sub-aggregation outputs.