Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing Data From ElasticSearch

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:

   http://localhost:9200/[indexName] 

However, that doesn't seem to actually remove the data (aka docs) themselves.

like image 605
user687554 Avatar asked Apr 07 '14 22:04

user687554


People also ask

Does deleting index in Elasticsearch delete data?

Yes, deleting the index, deletes all the data in that index.

How does Elasticsearch deletion work?

Elasticsearch lets you specify time-to-live for each added document, which means after that time has passed, the document is automatically deleted. This is very useful for certain applications, but it will cause heavy deletions over time.


1 Answers

If you ever need to delete all the indexes, this may come in handy:

curl -X DELETE 'http://localhost:9200/_all' 

Powershell:

Invoke-WebRequest -method DELETE http://localhost:9200/_all 
like image 169
kha Avatar answered Nov 09 '22 01:11

kha