Sorry if this sounds like a duplicate. I've been reading all the various count/aggregation threads and I haven't really been able to figure this one out yet.
POST /profile/_search
{
"size": 0,
"aggregations": {
"az_profile": {
"nested": {
"path": "az"
},
"aggregations": {
"duplicateCount": {
"terms": {
"field": "az.account",
"min_doc_count": 2,
"size": 1000
}
}
}
}
}
}
This returns me the counts each az.account with a minimum count of 2.
Now how would I add an aggregation to get a count for how many az.accounts that aggregation returned?
I basically need an integer count on my first aggregated query