0
0
Elasticsearchquery~5 mins

Bucket aggregations (terms, histogram) in Elasticsearch - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a terms aggregation in Elasticsearch?
A terms aggregation groups documents by unique values in a field, like sorting items into buckets based on categories or tags.
Click to reveal answer
beginner
How does a histogram aggregation work?
It groups numeric values into fixed-size intervals (buckets), like putting ages into ranges: 0-10, 11-20, etc.
Click to reveal answer
intermediate
What is the purpose of the size parameter in a terms aggregation?
It limits how many top unique terms (buckets) to return, like showing only the top 5 most common categories.
Click to reveal answer
intermediate
In a histogram aggregation, what does the interval parameter control?
It sets the width of each bucket, deciding how big each numeric range is, like grouping sales by every $100.
Click to reveal answer
advanced
Can you combine bucket aggregations in Elasticsearch?
Yes, you can nest bucket aggregations to group data in multiple layers, like grouping by category then by price ranges.
Click to reveal answer
What does a terms aggregation group documents by?
AUnique values in a field
BFixed numeric ranges
CDocument length
DDate ranges
Which parameter controls the number of buckets returned in a terms aggregation?
Asize
Binterval
Cfrom
Dorder
What does the histogram aggregation's interval parameter define?
ANumber of buckets
BBucket size (range width)
CSorting order
DField name
Which aggregation would you use to group documents by price ranges?
Aterms aggregation
Bfilter aggregation
Chistogram aggregation
Ddate histogram
Can bucket aggregations be nested inside each other?
ANo, only one level allowed
BOnly for terms aggregation
COnly for histogram aggregation
DYes, to create multi-level grouping
Explain how terms and histogram bucket aggregations differ and give a real-life example for each.
Think about sorting items by category vs. grouping numbers into intervals.
You got /4 concepts.
    Describe how you would use nested bucket aggregations to analyze sales data by region and price range.
    Imagine sorting sales first by location, then by price groups.
    You got /3 concepts.