Computing aggregation bucket size in actions


(rastro) #1

I'm trying to get the number of buckets in my aggregation.

I tried {{ ctx.payload.aggregations.myAgg.buckets.size() }}, but nothing was displayed. I've seen other posts using that method in conditions, but I need it in actions.

I would also like to get the sum of each bucket's doc_count (different than {{ }} when using min_doc_count).

(Alexander Reelsen) #2


mustache requires you to use {{ ctx.payload.aggregations.myAgg.buckets.size}} as there is no support for calling functions...


(rastro) #3

That worked; thanks.

(system) #4