How to delete an index in Elasticsearch? - Big Data In Real World

How to delete an index in Elasticsearch?

How to recursively delete files, folders or bucket from S3?
June 19, 2023
How to recursively upload a folder to S3 using AWS CLI?
July 3, 2023
How to recursively delete files, folders or bucket from S3?
June 19, 2023
How to recursively upload a folder to S3 using AWS CLI?
July 3, 2023

Simple 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
Big Data In Real World
Big Data In Real World
We are a group of Big Data engineers who are passionate about Big Data and related Big Data technologies. We have designed, developed, deployed and maintained Big Data applications ranging from batch to real time streaming big data platforms. We have seen a wide range of real world big data problems, implemented some innovative and complex (or simple, depending on how you look at it) solutions.

Comments are closed.

How to delete an index in Elasticsearch?
This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy.

Hadoop In Real World is now Big Data In Real World!

X