Complete the code to calculate the average of the field "price".
{
"aggs": {
"average_price": {
"[1]": {
"field": "price"
}
}
}
}The avg aggregation calculates the average value of a numeric field.
Complete the code to calculate the total sum of the field "quantity".
{
"aggs": {
"total_quantity": {
"[1]": {
"field": "quantity"
}
}
}
}The sum aggregation adds up all values of the specified field.
Fix the error in the aggregation type to find the minimum value of "age".
{
"aggs": {
"youngest": {
"[1]": {
"field": "age"
}
}
}
}The min aggregation finds the smallest value in the field.
Fill both blanks to calculate the maximum value of "score" and the average of "time".
{
"aggs": {
"max_score": {
"[1]": {
"field": "score"
}
},
"avg_time": {
"[2]": {
"field": "time"
}
}
}
}Use max to find the highest score and avg to find the average time.
Fill all three blanks to calculate the sum of "sales", the minimum of "discount", and the average of "rating".
{
"aggs": {
"total_sales": {
"[1]": {
"field": "sales"
}
},
"lowest_discount": {
"[2]": {
"field": "discount"
}
},
"average_rating": {
"[3]": {
"field": "rating"
}
}
}
}Use sum for total sales, min for lowest discount, and avg for average rating.
