Which class and functions in Java code to use for Aggregation queries using Low Level Rest Client for elastic

Which class and functions in Java code to use for Aggregation queries using Low Level Rest Client for elastic. Which Class to be used. AggregationBuilder class seems to be not present in older version like in High Level Client.

Like for below body of rest call what is the way to write Java code for getting search response using low level client on elastic 5.6.10.
{
"aggs": {
"total": { "sum": { "field": "accountbalance" } }
}
}

I'm afraid you have to do all this manually.

Best option IMO is to upgrade to 7.9.2.

Did not get manually meaning. You mean it can be only done in browser search using _search url only and not from java code.
You mean with Java code there is no way to get Aggregate query search using RestClient in low level clients in older elastic version? Or there is some way or other.

I meant that with the Low Level client, you need to build the request as a Json document (a String basically) and parse yourself the json response (a String).

1 Like

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