How to delete multiple documents by id in specific txt file or json using CURL command

Hello,

i have a txt file that contains some documents id and i want to execute a curl XDELETE to delete all this documents from my index at once.

my txt file contains ids like this :
12
24
33
48

do you have any suggestion on how to achieve this action using curl XDELETE cmd ?

Best Regards !

You can use https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html with https://www.elastic.co/guide/en/elasticsearch/reference/7.0/query-dsl-ids-query.html

Or you can generate a bulk request and use the bulk API: https://www.elastic.co/guide/en/elasticsearch/reference/7.0/docs-bulk.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.