1

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

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

How to add the query string parameters such as size , timeout in Deletebyquery query request? its mentioned in doc but do not know how to add in java api! elastic.co/guide/en/elasticsearch/plugins/2.3/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.