Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save FabienSalles/a93c5c24e2093f8de58f0d3e66829c67 to your computer and use it in GitHub Desktop.
Save FabienSalles/a93c5c24e2093f8de58f0d3e66829c67 to your computer and use it in GitHub Desktop.
Elastic search curl commad
Using cURL
curl -XDELETE localhost:9200/index/type/documentID
e.g.
curl -XDELETE localhost:9200/shop/product/1
You will then receive a reply as to whether this was successful or not. You can delete an entire index or types with an index also, you can delete a type by leaving out the document ID like so -
curl -XDELETE localhost:9200/shop/product
If you wish to delete an index -
curl -XDELETE localhost:9200/shop
If you wish to delete more than one index that follows a certain naming convention (note the *, a wildcard), -
curl -XDELETE localhost:9200/.mar*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment