I have the following aggregation query that I tested and run fine. I am wondering how to build the equivalent query using its JAVA API. In fact I have a List<String> of each element I'd like to see the stats. How can I do this dynamically?
Thank you in advance.
{
"from" : 0,
"size" : 0,
"aggs": {
"value_stats" :{
"stats": {
"field" : "value"
}
},
"qty_stats":{
"stats": {"field" : "qty"}
}
}
}