Add an option to write the aggregation type in the response #7278
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It would be wonderful if this could also be merged with branch 1.x.
ouput would be like :