$ curl -XDELETE ‘http://localhost:9200/twitter/tweet/1’
查看文档,没有满足该类需求的方法,偶然看见文档如下:
Delete By Query Pluginedit The delete-by-query plugin adds support for deleting all of the documents (from one or more indices) which match the specified query. It is a replacement for the problematic delete-by-queryfunctionality which has been removed from Elasticsearch core.
Internally, it uses Scroll and Bulk APIs to delete documents in an efficient and safe manner. It is slower than the old delete-by-query functionality, but fixes the problems with the previous implementation.
To understand more about why we removed delete-by-query from core and about the semantics of the new implementation, see Why Delete-By-Query is a plugin.
**安装插件 sudo bin/plugin install delete-by-queryThe plugin must be installed on every node in the cluster, and each node must be restarted after installation.
**卸载插件 sudo bin/plugin remove delete-by-queryThe node must be stopped before removing the plugin.
**使用 $ DELETE /twitter/tweet/_query?q=user:kimchy