โ Elasticsearch learning pathElasticsearch ยท Module 6 of 10
Aggregations
Aggregations summarise data, like GROUP BY in SQL.
๐ Key ideas
- terms aggregation groups by a keyword field and counts each group.
- avg, sum, min and max compute metrics.
- date_histogram buckets documents by day, week or month.
- Aggregations can be nested: per city, the average order value.
- Set "size": 0 when you only want aggregation results.
๐ก Real-life example: Like counting votes after an election: how many per party, per district, per hour.
BucketA group of documents in an aggregation
MetricA number computed over documents
terms aggGroups by distinct values
date_histogramGroups by time interval