ElasticsearchBundle
ElasticsearchBundle copied to clipboard
Add delete by query support
https://www.elastic.co/guide/en/elasticsearch/reference/1.6/docs-delete-by-query.html
IMO we should leave the function but instead to call deleteByQuery maybe we should form search query for ID's and then create bulk remove query?
Ideas?
I think we should remove it for now.
Trying to match Elastic API maybe it's a way to go. Then let's remove it.
Seems there is a plugin wich provides delete by query functionality
https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/plugins-delete-by-query.html
Well, internally this plugin uses Scroll and Bulk APIs to delete documents in an efficient and safe manner. It is slower than the old delete-by-query functionality but fixes the problems with the previous implementation.
To support third-party plugins it's big overhead for the bundle and we do not know when it might have breaking changes or not compatible with some specific version. IMO we could keep deleteByQuery by representing this plugin functionality. Get the ID's and run bulk delete.
When we upgraded to ES 2.x, we installed delete-by-query plugin very early and saw no problems. If I were you, I would just rely on that plugin. It's not 3rd party, it's maintained by Elastic.
Since we implemented exception throwing this is quite safe to implement the functionality provided by plugins. I think we could include delete by query function.
Delete by query is still in documentation (up to master branch). https://www.elastic.co/guide/en/elasticsearch/reference/6.4/docs-delete-by-query.html
Maybe this feature should came back?
It was deprecated in the previous versions and now seems were returned back. So yeah, we can definitely bring this back to the bundle.
Seems like it is now a stable endpoint in the v6. Will add this to the bundle v6 as well.
https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docs-delete-by-query.html