How to parse sub-aggregation JSON fragment of the search response?

I have a custom parser that fails early (i.e. aborts parsing immediatey) if some elements of the response contents do not meet expected values. Failing early means that some of the responses elements are evaluated/checked before the response is fully consumed - so it does not exactly rely on the built-in functionality of the JAVA High-Level Rest API.

However, since sub-aggregations may become quite complex, especially with nesting, I am looking for a simple way to parse the sub-aggregations from a partial string (obtained by external iteration/deserialization) of the search response. It seems that the QueryBuilders have a parse() method that can create objects from an XContentParser (e.g. AvgAggregationBuilder parse(String aggregationName, XContentParser parser) ). However, I couldn't find something like Avg.parse(...).

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.