Elasticsearch json response to SearchResponse object

As far as I can read the code

It looks like innerFromXContent is also parsing the aggs part.

This is calling:

Behind the scene this needs to know what kind of aggregation you asked for, what is the java type to use. The magic is happening here:

So you need to add a prefix like terms# if you are getting back a terms aggregation.

terms#foo as the javadoc example says.

I hope this can help.

1 Like