Hi,
providing json is not really what the high-level REST client is meant for, it's more to avoid having to deal with json. You may be able to achieve parsing that json into a temporary SearchSourceBuilder using its fromXContent method, then you can retrieve the aggs in object format using the aggregations getter and set them back to another SearchSourceBuilder instance, which I presume would have also other sections set (query etc.) using the aggregation setter.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.