Do you know how I can delete document in one curl command ?
I have a index called "myindex". I want to delete all document where the field prediction is like "yes"
With Elasticsearch 2.1, I use:
curl.exe -XDELETE http://XX.XX.XX.XX:9200/myindex/core2/_query?q=prediction:yes
With Elasticsearch 6.1.1, it does not work.
The syntax you have was for ES 2.4. With ES 5 the delete by query API endpoint has changed name, from
_delete_by_query, so this should work (also make sure to use the POST method and not DELETE):
curl.exe -XPOST http://XX.XX.XX.XX:9200/myindex/core2/_delete_by_query?q=prediction:yes
Great, glad to hear it worked out!
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.