(十二)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刪除全部文檔會更有效。
相關文章
相關標籤/搜索