How to recursively delete files, folders or bucket from S3?
June 19, 2023How to recursively upload a folder to S3 using AWS CLI?
July 3, 2023Simple problem with a simple solution. In this post we will see how to delete an index in Elasticsearch.
Solution
We have 3 indices in Elasticsearch at the moment.
curl http://localhost:9200/_cat/indices?v health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open account_v2 Kws5DlAdQuCv8845NZPUhQ 1 1 993 0 393.5kb 393.5kb yellow open account_v3 vqWW9i3KSD-wjqFH5kFWwg 1 1 20 0 17.4kb 17.4kb yellow open account avtO6o3jTmWtgAyQwTTM6Q 1 1 993 7 400.9kb 400.9kb
We issue a DELETE on the index name to delete the index.
curl -X DELETE "localhost:9200/account_v3?pretty" { "acknowledged" : true }
The index is now gone as expected.
curl http://localhost:9200/_cat/indices?v health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open account_v2 Kws5DlAdQuCv8845NZPUhQ 1 1 994 0 402.6kb 402.6kb yellow open account avtO6o3jTmWtgAyQwTTM6Q 1 1 994 7 406.6kb 406.6kb