* Sets a raw (xcontent / json) addAggregation.
*/
public SearchSourceBuilder aggregations(Map aggregations) {
try {
XContentBuilder builder = XContentFactory.contentBuilder(Requests.CONTENT_TYPE);
builder.map(aggregations);
return aggregations(builder);
} catch (IOException e) {
throw new ElasticsearchGenerationException("Failed to generate [" + aggregations + "]", e);
}
}