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

Deleting multiple documents at once #237

Closed
Jensxy opened this issue Oct 30, 2018 · 6 comments
Closed

Deleting multiple documents at once #237

Jensxy opened this issue Oct 30, 2018 · 6 comments
Milestone

Comments

@Jensxy
Copy link

Jensxy commented Oct 30, 2018

I would like to delete multiple documents from a index with a id. For example, I like to delete the documents with the ids test_6, test_7 and test_8. How do I use docs_delete to delete them all at once?

@sckott sckott added this to the v0.9 milestone Oct 30, 2018
@sckott
Copy link
Contributor

sckott commented Oct 30, 2018

is it okay for your use case to do an lapply or for loop? e.g.,

ids <- c(1, 5, 8)
lapply(ids, function(z) docs_delete(index='plos', type='article', id=z))

there is the delete by query API, but we don't have it implemented yet #195 - does the delete by query API do what you need?

@Jensxy
Copy link
Author

Jensxy commented Oct 30, 2018

Yes, I will use lapply. Thank you very much.

@sckott
Copy link
Contributor

sckott commented Oct 31, 2018

okay, i am going to implement the delete by query API at some point, so you can try that too when it's done

@Jensxy
Copy link
Author

Jensxy commented Oct 31, 2018

Okay, that would be nice because lapply takes very long. I don't know if delete by query would improve the performance.

@sckott
Copy link
Contributor

sckott commented Oct 31, 2018

i don't know if it would improve either, we'll see

@sckott sckott modified the milestones: v0.9, v1.0 Dec 31, 2018
sckott added a commit that referenced this issue Dec 31, 2018
…ery API

tweeked  internal method es_POST that is also used by cluster fxns, those tests pass with changes
@sckott
Copy link
Contributor

sckott commented Dec 31, 2018

@Jensxy this is implemented now. remotes::install_github("ropensci/elastic@r6-conn") see docs_delete_by_query()

@sckott sckott closed this as completed Dec 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants