I made some elastic query like below.
"aggregations": {
"state": {
"nested": {
"path": "events"
},
"aggregations": {
"by_act": {
"cardinality": {
"field": "events.activityoid"
}
}
}
},
"by_event": {
"sum": {
"field": "eventcnt"
}
}
And here is part of result.
"aggregations": {
"by_event": {
"value": 132
},
"state": {
"doc_count": 1874,
"by_act": {
"value": 12
},
I can get 'by_event' value with
result.getAggregations().getCardinalityAggregation( "by_cases").getCardinality();
But Don't know How to get 'by_act' value, since it's not in bucket. Any idea of this?