企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# Delete an Index(删除索引) 原文链接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/_delete_an_index.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/_delete_an_index.html) 译文链接 : [http://www.apache.wiki/pages/viewpage.action?pageId=4260704](http://www.apache.wiki/pages/viewpage.action?pageId=4260704) 贡献者 : [那伊抹微笑](/display/~wangyangting),[ApacheCN](/display/~apachecn),[Apache中文网](/display/~apachechina) 现在让我们删除我们刚才创建的索引并且再次列出所有索引 :  ``` curl -XDELETE 'localhost:9200/customer?pretty&pretty' curl -XGET 'localhost:9200/_cat/indices?v&pretty' ``` 响应如下 :  ``` health status index uuid pri rep docs.count docs.deleted store.size pri.store.size ``` 这意味着索引被成功的删除,并且我们现在又回到了集群中什么都没有的时候了。 在我们继续之前,让我们仔细的看一看一些我们迄今为止学习的 **API** 命令 :  ``` curl -XPUT 'localhost:9200/customer?pretty' curl -XPUT 'localhost:9200/customer/external/1?pretty' -d' { "name": "John Doe" }' curl -XGET 'localhost:9200/customer/external/1?pretty' curl -XDELETE 'localhost:9200/customer?pretty' ``` 如果我们仔细的研究上面的命令,我们可以清楚的看到,我们如何访问 **Elasticsearch** 中的数据的 **pattern**(模式)。该 **pattern**(模式)可以概括如下 :  ``` <REST Verb> /<Index>/<Type>/<ID> ``` 在所有的 **API** 命令中这个 **REST** 访问模式是很常见的,如果您可以简单的记住它,在掌握 **Elasticsearch** 时您会有一个良好的开端。