Reference Entry
Numeric and Date Aggregations
Discovery · advanced · order 20
A map of the numeric and date aggregation helpers available on NumericFieldIndex and DateFieldIndex.
Relevant APIs
Numeric and Date Aggregations
NumericFieldIndex and DateFieldIndex expose a small aggregation surface for metric summaries and bucketed navigation.
The available helpers are:
valueCount()min()max()sum()avg()stats()rangeAggregation(...)histogram(...)dateHistogram(...)
They run directly on the in-memory field data and can optionally be restricted to a subset of matching document ids.
Feature articles
- Value Count Aggregation
- Min Aggregation
- Max Aggregation
- Sum Aggregation
- Avg Aggregation
- Stats Aggregation
- Range Aggregation
- Histogram Aggregation
- Date Histogram Aggregation
Shared behavior
All of these helpers support optional subset ids so the aggregation can reflect the current result set instead of the full corpus.
Metric-style aggregations operate on values.
Bucket-style aggregations operate on document counts:
- a document contributes once per matching bucket
- a multi-valued document may contribute to multiple buckets
That is usually the right default for facets and sidebars.