在 ElasticSearch 2.x 中删除某个类型的所有文档 [英] DELETE all documents of a type in ElasticSearch 2.x
问题描述
我已将 ElasticSearch 更新到 2.1 版本.
I've updated ElasticSearch to 2.1 version.
在此之前,我使用以下方法删除了一个类型中的每个文档:
Before of that, I deleted every document in a type using:
curl -XDELETE '<server_node>:<port>/<index>/<type>' -i
curl -XDELETE 'http://ESNode01:9201/living/inputs' -i
从现在开始,这是回应:
From now then, this is the response:
HTTP/1.1 400 Bad Request Content-Type: text/plain;字符集=UTF-8
HTTP/1.1 400 Bad Request Content-Type: text/plain; charset=UTF-8
内容长度:61
未找到 uri [/living/inputs] 和方法 [DELETE] 的处理程序
No handler found for uri [/living/inputs] and method [DELETE]
我做错了什么?
推荐答案
删除映射类型是 从 2.0 起不再支持.
如果您只是需要删除文档,那么您可以使用通过查询插件删除,否则你应该创建一个没有你想要删除的映射的新索引并重新索引你的数据.
If you just need to delete the documents, then you may use the delete by query plugin, otherwise you should create a new index without the mapping you want to delete and reindex your data.
这篇关于在 ElasticSearch 2.x 中删除某个类型的所有文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!