This seems to work, is it the best way?
In a pivot transform, I want a count of the documents included in the aggregation. I tried this and it seemed to work. However feeling uneasy without a vote of confidence from the community.
I tried this aggregation:
"pivot": {
"group_by": {
// omitted
},
"aggregations": {
"job_count": {
"value_count": {
"field": "_id"
}
}
}
}