The transport client supports the following Elastic example:
AggregationBuilder aggregation =
SearchResponse sr = client.prepareSearch() .setQuery(QueryBuilders.termQuery("gender", "male")) .addAggregation(aggregation) .get();
I cannot locate in the REST client a point where .setQuery() can be invoked.
My objective is to establish an overall query for a multi-bucket aggregation.