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

Support delete-by-query #15

Open
outoftime opened this issue Jun 26, 2012 · 2 comments
Open

Support delete-by-query #15

outoftime opened this issue Jun 26, 2012 · 2 comments
Assignees
Milestone

Comments

@outoftime
Copy link
Contributor

E.g.:

Post.query { constant_score { term(:author_id => 1) }}.delete_all

Not clear how this should work with queries vs. filters etc...

@ghost ghost assigned outoftime Jun 26, 2012
@kostia
Copy link

kostia commented Oct 19, 2012

+1

Ist there an update_all equivalent?

@outoftime
Copy link
Contributor Author

Sort of -- there's the ::update_each method, which updates each document matching the scope it's called on in a concurrency-safe way. It still performs one write operation per document, since ElasticSearch doesn't have anything equivalent to an UPDATE...WHERE ? IN ? statement. Of course you can make that a bit more efficient by doing it in a bulk block.

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