Posted By: Anonymous
I’m new to ElasticSearch. I’m trying to figure out how to remove data from ElasticSearch. I have deleted my indexes. However, that doesn’t seem to actually remove the data itself. The other stuff I’ve seen points to the Delete by Query feature. However, I’m not even sure what to query on. I know my indexes. Essentially, I’d like to figure out how to do a
DELETE FROM [Index]
From PostMan in Chrome. However, I’m not having any luck. It seems like no matter what I do, the data hangs around. Thus far, I’ve successfully deleted the indexes by using the DELETE HTTP Verb in PostMan and using a url like:
However, that doesn’t seem to actually remove the data (aka docs) themselves.
You can delete using
cURL or visually using one of the many tools that open source enthusiasts have created for Elasticsearch.
curl -XDELETE localhost:9200/index/type/documentID
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*
There are various tools as mentioned above, I wont list them here but I will link you to one which enables you to get started straight away, located here. This tool is called KOPF, to connect to your host please click on the logo on top left hand corner and enter the URL of your cluster.
Once connected you will be able to administer your entire cluster, delete, optimise and tune your cluster.