elasticsearch/elasticsearch — pull request #7278 by obourgain (2014-08-14 11:27:17+00:00)
Title: Add an option to write the aggregation type in the response

This pull requests add two optional parameters to the aggregations toXContent, one to write the TYPE of the aggregation and the other to write the classname of the aggregation.

The type field exists for facets but not for aggregations. I believe these informations can be usefull to create mappers without having to either rely on the request or infering the type from the response.

Existing client will not be impacted because the new informations are optional, but they may start to use it.

Suggestions for the fields and parameters names are welcome.
Maybe writing class.getSimpleName() is more robust than class.getName() in regard of refactorings.