I have the following query that works well:
{
"query":{
"bool": {"filter": [{"match": {"name.raw": name}}, {'match':{'store.raw': store}}]}
},
"aggs":{
"products":{
"terms": {"field": "name.raw"},
"aggs":{"stats_price": {"stats": { "field": "price"}}}
}
},
"post_filter": {
"geo_distance":{
"distance": distance,
"location": {"lon": lon, "lat": lat}
}
}
}
However I fail to find a version of this request where I would have the aggregation done per ring.
So that I would be the result of aggs :{"stats_price": {"stats": { "field": "price"}}}
per ring within a range [{"from": 0, "to": 3}, {"from": 0}]
(from 0 would be an aggregation on all the data)