💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# Deleting Documents(删除文档) 原文链接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/_deleting_documents.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/_deleting_documents.html) 译文链接 : [http://www.apache.wiki/pages/viewpage.action?pageId=4260717](http://www.apache.wiki/pages/viewpage.action?pageId=4260717) 贡献者 : [那伊抹微笑](/display/~wangyangting),[ApacheCN](/display/~apachecn),[Apache中文网](/display/~apachechina) 删除文档是很简单的,这个例子演示了如何去删除我们先前 **ID** 为 **2** 的 **customer**(的文档)。 ``` curl -XDELETE 'localhost:9200/customer/external/2?pretty&pretty' ``` 请看 [_Delete By Query API_](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete-by-query.html "Delete By Query API") 以删除指定查询匹配到的所有文档。值得注意的是,它是删除一个完整的索引更有效的方式,而不是使用 [_Delete By Query API_](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/docs-delete-by-query.html "Delete By Query API") 来删除所有的文档。