Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java High Level Rest Client allowing "delete by query" #26928

Closed
lengerad opened this issue Oct 9, 2017 · 2 comments
Closed

Java High Level Rest Client allowing "delete by query" #26928

lengerad opened this issue Oct 9, 2017 · 2 comments
Labels

Comments

@lengerad
Copy link

lengerad commented Oct 9, 2017

Describe the feature:
I run into a case where I want to simply remove all documents witch specific date field (let's say "delete all documents where timestamp inserted is older than one day"). So far I found out that in JHLRest client documentation, the only possibility is to delete documents by ID, does it mean that I have to fetch all the IDs which meet the condition and delete them?

Would it be possible to add something like delete by query in here ? I went to elasticsearch forum and it seems that I'm not the only one who run into this issue:
https://discuss.elastic.co/t/delete-by-query-using-java-high-level-rest-client/102507

I tried to find issue for this but I wasn't successful, so in case that this feature request already exists, please mark this as duplicate.

Also any hints about temporary solution? Should I find the IDs and then remove it or use the approach mentioned in the elastic forum?

@javanna
Copy link
Member

javanna commented Oct 9, 2017

hi @lengerad thanks for opening this issue. For now the temporary solution would be to use the low-level REST client to send the delete by query request. You can probably build the query and some of the request body through the current java API objects, then send the output over to Elasticsearch as a byte[]. Unfortunately the response has also to be parsed manually from a byte[].

@javanna
Copy link
Member

javanna commented Nov 1, 2017

We are setting our end goal as possibly feature parity with the Transport Client. It will take time though. That means that we do want to add support for delete by query, as well as many other API that Elasticsearch exposes. We are tracking API completeness of the high-level REST client as part of #27205 , hence I am closing this issue in favour of #27205 .

@javanna javanna closed this as completed Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants