Update multiple documents in Elastic search using java

In java which querybuilder to use update all the documents in this specified range.!..This is my java code.
Code ---->
UpdateByQueryRequest requested = new UpdateByQueryRequest(arr[1]);
for (Entry<String, String> entry : m1.entrySet())
QueryBuilder matchQueryBuilder = QueryBuilders.rangeQuery(entry.getKey()).lt(entry.getValue());
for (Entry<String, String> entry : m.entrySet())
QueryBuilder q=QueryBuilders.boolQuery();
BulkByScrollResponse bulkResponse =client.updateByQuery(requested, RequestOptions.DEFAULT);
long updateddocuments = bulkResponse.getUpdated();

Your details should be updated successfully,No of documents updated:"+updateddocuments+"

First i have set the query for specified range by using rangeQuery and i need to update the data in that range.. Please give me the sollution to update the data in this specified range using RestHighLevelClient api.!

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