I'm making a pricecomparison website. Many products has multiple webshops (prices). For each result based on a match query, I want to return the cheapest price of each result.
For example: the match query returns 30 results based on the title: "test". Every single results show the cheapest price.
Now I have this code:
GET /products/_search?
{
"query": {
"match": {
"title": "test"
}
},
"aggs": {
"Min": {
"min": {
"field": "price"
}
}
}
}
It returns now 1 aggregation over all results.