删除索引

现在我们把之前的索引删除掉, 然年再列出所有的索引.

DELETE /customer?pretty
GET /_cat/indices?v

响应如下

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

这意味着这个索引被删除了. 我们又回到了集群中一无所有的状态.

在我们继续之前, 我们再更深一步看看之前我们用过的API命令.

PUT /customer
PUT /customer/_doc/1
{
  "name": "John Doe"
}
GET /customer/_doc/1
DELETE /customer

如果我们仔细观察上面的命令, 我们会发现Elasticsearch访问数据的模式, 这些模式总结如下:

<REST Verb> /<Index>/<Type>/<ID>

这样的REST访问模式在API命令里很常见, 如果你能记住他们, 你就对掌控Elasticsearch有了一个良好的开端.

results matching ""

    No results matching ""