Min Aggregation
The min aggregation finds the minimum value of a numeric field. Let’s find the minimum price of products.
Query:
GET /products/_search
{
"size": 0,
"aggs": {
"min_price": {
"min": {
"field": "price"
}
}
}
}
Output
{
"aggregations": {
"min_price": {
"value": 100.0
}
}
}
In this example, the minimum price of products is $100.0.
Metric Aggregation in Elasticsearch
Elasticsearch is a powerful tool not just for search but also for performing complex data analytics. Metric aggregations are a crucial aspect of this capability, allowing users to compute metrics like averages, sums, and more on numeric fields within their data.
This guide will delve into metric aggregations in Elasticsearch, explaining what they are, how they work, and providing detailed examples to illustrate their use.
Contact Us