Complete the code to create a terms aggregation on the field "user.keyword".
{
"aggs": {
"users": {
"terms": {
"field": "[1]"
}
}
}
}Complete the code to create a histogram aggregation on the field "price" with interval 50.
{
"aggs": {
"price_ranges": {
"histogram": {
"field": "price",
"[1]": 50
}
}
}
}Fix the error in the terms aggregation by completing the missing parameter to limit the number of buckets to 5.
{
"aggs": {
"top_users": {
"terms": {
"field": "user.keyword",
"[1]": 5
}
}
}
}Fill both blanks to create a histogram aggregation on "age" with interval 10 and include only buckets with doc_count greater than 5.
{
"aggs": {
"age_histogram": {
"histogram": {
"field": "age",
"[1]": 10
},
"aggs": {
"filtered_buckets": {
"bucket_selector": {
"buckets_path": {
"count": "_count"
},
"script": "params.count [2] 5"
}
}
}
}
}
}Fill all three blanks to create a nested aggregation: a terms aggregation on "category.keyword", with a sub-aggregation histogram on "price" with interval 20, and limit the terms buckets to 3.
{
"aggs": {
"categories": {
"terms": {
"field": "[1]",
"[2]": 3
},
"aggs": {
"price_ranges": {
"histogram": {
"field": "price",
"[3]": 20
}
}
}
}
}
}