Deleting an Index

Published on January 16, 2016 by

Now that we have created an index, let’s see how we can delete an index. In fact, we are going to delete the index that we created in the previous article in this series and add it again later.

Open the Sense plugin for Kibana and simply issue the below request to delete the index.

DELETE /ecommerce

Let’s ensure that the index was deleted correctly by listing all of the indexes within our cluster.

GET /_cat/indices?v

Result:

health status index pri rep docs.count docs.deleted store.size pri.store.size
yellow open .kibana 1 1 2 0 5kb 5kb

As you can see, we no longer have an index with a name of ecommerce. Thanks to the REST API that Elasticsearch exposes, it is really that easy to delete an index in Elasticsearch.

Featured

Learn Elasticsearch today!

Take an online course and become an Elasticsearch champion!

Here is what you will learn:

  • The architecture of Elasticsearch
  • Mappings and analyzers
  • Many kinds of search queries (simple and advanced alike)
  • Aggregations, stemming, auto-completion, pagination, filters, fuzzy searches, etc.
  • ... and much more!
Elasticsearch logo
Author avatar
Bo Andersen

About the Author

I am a back-end web developer with a passion for open source technologies. I have been a PHP developer for many years, and also have experience with Java and Spring Framework. I currently work full time as a lead developer. Apart from that, I also spend time on making online courses, so be sure to check those out!

Leave a Reply

Your e-mail address will not be published.