Bucket Aggregations
Facets/aggregations are a ParadeDB enterprise feature. Contact us for access.
Histogram
Histogram is a bucket aggregation where buckets are created dynamically based on a specified interval. Each document value is rounded down to its bucket. For example, if you have a price of 18 and an interval of 5, the document will fall into the bucket with the key 15. The formula used for this is: ((val - offset) / interval).floor() * interval + offset
.
The field to aggregate on.
The interval to chunk your data range. Each bucket spans a value range of [0..interval). Must be a positive value.
Shift the grid of buckets by the specified offset.
The minimum number of documents in a bucket to be returned.
Limits the data range to [min, max] closed interval.
Extends the value range of the buckets.
Whether to return the buckets as a hash map.
Whether the values are normalized to ns for date time values.
Date Histogram
Similar to histogram, but can only be used with date types. Currently, only fixed time intervals are supported.
The field to aggregate on.
The interval to chunk your data range. Each bucket spans a value range of
[0..fixed_interval). Accepted values should end in ms
, s
, m
, h
, or
d
.
Shift the grid of buckets by the specified offset.
The minimum number of documents in a bucket to be returned.
Limits the data range to [min, max] closed interval.
Extends the value range of the buckets.
Whether to return the buckets as a hash map.
Range
Range aggregation allows you to define custom buckets for specific ranges.
The field to aggregate on.
A list of ranges to aggregate on.
Whether to return the buckets as a hash map.
Terms
Terms aggregation creates a bucket for every unique term and counts the number of occurrences.
The field to aggregate on.
The number of terms to return.
The number of terms to fetch from each segment.
Whether to include the document count error.
The minimum number of documents in a term to be returned.
The value to use for documents missing the field.
Nested Aggregations
Buckets can contain sub-aggregations. For example, creating buckets with the range aggregation and then calculating the average on each bucket:
Was this page helpful?