I am using Elasticsearch version 2.3.1
I want to implement Deletebyquery of ES in java
Es have docs for that https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html
This doc stats that In deletebyquery request we can have a params like wait_for_completion=false , wait_for_active_shards , etc
This is fine for curl request, But my problem is I want to implement the same using java api, with that wait_for_completion flag set.
My java code for Deletebyquery in java
DeleteByQueryRequestBuilder deleteRequest = DeleteByQueryRequestBuilder(esType, DeleteByQueryAction.INSTANCE)
.setIndices(index)
.setTypes(type);
deleteRequest.setQuery(boolQuery);
DeleteByQueryResponse resp = deleteRequest.get();
I want to know where I can add wait_for_completion flag in java api request, kindly advice me. Thanks
The document link provided in the OP is for the latest version of elasticsearch.
Elasticsearch 2.3 supports DeleteByQuery only via a plugin.
The external plugin does not have wait_for_completion
option.
The feature was re-introduced in 5.x.