Combine multiple terms aggregation as a pipeline

Lets say I have two fields in my docs location and projects. I want a terms aggregation on locations first and then on each of the aggregated buckets run a terms aggregation on projects. Is this possible? I went through the docs but was unable to find a pipeline aggregation using terms


can you explain why you need a pipeline agg for this? This sounds like having a terms on the location first and then a inner aggregation on the projects so that you get aggregations per project-per location sounds like this already solved the problem.

What am I missing?


Yes thats right, I shouldn't have used the term pipeline I guess sounds confusing but I thought since it project based aggreagtion will work on the output of location based agg so I thought I might need to use a pipeline for it.

@spinscale are successive terms aggregation possible?

Yes, take another closer look at the structure at

There is also an example using the max aggregation in the terms agg docs, see

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.