(九)Delete an Index

Now let’s delete the index that we just created and then list all the indexes again:json

如今讓咱們刪除剛剛建立的索引,而後再次列出全部索引:

curl -X DELETE "localhost:9200/customer?pretty"
curl -X GET "localhost:9200/_cat/indices?v"app

And the response:curl

health status index uuid pri rep docs.count docs.deleted store.size pri.store.size

Which means that the index was deleted successfully and we are now back to where we started with nothing in our cluster.ui

這意味着索引已成功刪除,咱們如今回到咱們在集羣中沒有任何內容的地方。
 
Before we move on, let’s take a closer look again at some of the API commands that we have learned so far:
在咱們繼續以前,讓咱們再仔細看看到目前爲止咱們學到的一些API命令:
curl -X PUT "localhost:9200/customer"
curl -X PUT "localhost:9200/customer/_doc/1" -H 'Content-Type: application/json' -d'
{
  "name": "John Doe"
}
'
curl -X GET "localhost:9200/customer/_doc/1"
curl -X DELETE "localhost:9200/customer"

If we study the above commands carefully, we can actually see a pattern of how we access data in Elasticsearch. That pattern can be summarized as follows:url

若是咱們仔細研究上述命令,咱們實際上能夠看到咱們如何在Elasticsearch中訪問數據的模式。該模式可概括以下:
<REST Verb> /<Index>/<Type>/<ID>
<url>/<Index>/<Type>/<Id>

This REST access pattern is so pervasive throughout all the API commands that if you can simply remember it, you will have a good head start at mastering Elasticsearch.spa

這種REST訪問模式在全部API命令中都很是廣泛,若是你能記住它,你將在掌握Elasticsearch方面有一個良好的開端。
相關文章
相關標籤/搜索