{
"aggs": {
"my-agg-name": {
"terms": {
"field": "my-field"
},
"aggs": {
"my-sub-agg-name": {
"avg": {
"field": "my-other-field"
}
}
}
}
}
}
I wanted to perform the above elastic search query in java using the new elasticsearch java api client . I am using elastic search version 7.16 . Can someone please help me in building the same query using the new elasticsearch java api client .