elasticsearch/elasticsearch — pull request #6985 by colings86 (2014-07-23 14:21:43+00:00)
Title: Aggregations: Better JSON output scoping

Before this change each aggregation had to output an object field with its name and write its JSON inside that object. This allowed for badly behaved aggregations which could write JSON content in the root of the 'aggs' object. this change move the writing of the aggregation name to a level above the aggregation itself, ensuring that aggregations can only write within there own scope in the JSON output.