Recall & Review
beginner
What is a filter aggregation in Elasticsearch?
A filter aggregation lets you count or analyze documents that match a specific filter condition, like counting only documents with a certain field value.
Click to reveal answer
beginner
How do you define a filter aggregation in an Elasticsearch query?
You define it by specifying a
filter with a query inside the aggregation, like "filter": { "term": { "status": "active" } }.Click to reveal answer
intermediate
Can filter aggregation be combined with other aggregations?
Yes! You can nest other aggregations inside a filter aggregation to analyze only the filtered documents further.
Click to reveal answer
intermediate
What is the difference between filter aggregation and filters aggregation?
Filter aggregation uses one filter to select documents. Filters aggregation lets you define multiple filters and get results for each filter separately.
Click to reveal answer
beginner
Example: What does this filter aggregation do?
{
"aggs": {
"active_users": {
"filter": { "term": { "status": "active" } }
}
}
}It counts how many documents have the field
status set to active. The result is the number of active users.Click to reveal answer
What does a filter aggregation do in Elasticsearch?
✗ Incorrect
Filter aggregation counts or analyzes documents that match a specific filter condition.
Which key is used to specify the filter in a filter aggregation?
✗ Incorrect
The "filter" key defines the filter condition inside a filter aggregation.
Can you nest other aggregations inside a filter aggregation?
✗ Incorrect
You can nest other aggregations inside a filter aggregation to analyze filtered documents further.
What is the main difference between filter and filters aggregations?
✗ Incorrect
Filter aggregation applies one filter; filters aggregation applies multiple filters separately.
In this filter aggregation, what does it count?
{
"filter": { "term": { "status": "active" } }
}✗ Incorrect
It counts documents where the field "status" equals "active".
Explain how filter aggregation works in Elasticsearch and give a simple example.
Think about how you count only certain documents using a filter.
You got /3 concepts.
Describe the difference between filter aggregation and filters aggregation.
One uses one filter, the other uses many filters at once.
You got /3 concepts.