ElasticsearchBundle icon indicating copy to clipboard operation
ElasticsearchBundle copied to clipboard

Add delete by query support

Open saimaz opened this issue 9 years ago • 9 comments

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?

saimaz avatar Jan 12 '16 07:01 saimaz

I think we should remove it for now.

mvar avatar Feb 01 '16 09:02 mvar

Trying to match Elastic API maybe it's a way to go. Then let's remove it.

saimaz avatar Feb 01 '16 09:02 saimaz

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

saimaz avatar Mar 15 '16 20:03 saimaz

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.

saimaz avatar Jul 11 '16 08:07 saimaz

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.

tautrimas avatar Aug 31 '16 07:08 tautrimas

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.

saimaz avatar Oct 04 '16 11:10 saimaz

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?

kwojc avatar Oct 30 '18 21:10 kwojc

It was deprecated in the previous versions and now seems were returned back. So yeah, we can definitely bring this back to the bundle.

saimaz avatar Oct 30 '18 21:10 saimaz

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

saimaz avatar Mar 21 '19 21:03 saimaz