"Global aggregators can only be placed as top level aggregators because it doesn’t make sense to embed a global aggregator within another bucket aggregator."
Can you give a bit more context of what you're trying to achieve? The global aggregation is just a way to "escape" the query context. E.g. a query may match a subset of the documents, which are then given to the aggregation for calculating metrics, etc.
The Global agg lets you run aggregations on all the documents, whether they matched the query or not.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.