(十二)Deleting Documents

Deleting a document is fairly straightforward. This example shows how to delete our previous customer with the ID of 2:html

删除文档很是简单。此示例显示如何删除ID为2的之前的客户:
DELETE /customer/_doc/2?pretty

See the _delete_by_query API to delete all documents matching a specific query. It is worth noting that it is much more efficient to delete a whole index instead of deleting all documents with the Delete By Query API.elasticsearch

请参阅_delete_by_query API以删除与特定查询匹配的全部文档。值得注意的是,删除整个索引而不是使用Delete By Query API删除全部文档会更有效。
相关文章
相关标签/搜索