DELETE: http://{{elasticip}}:9200/{{index}}/_doc/101
如果我知道该文档的所有216000个值,如何一次删除所有216000个文档
_id
文档的字段?
update_by_query
delete_by_query
函数也可用,但我从未尝试过。假设我需要删除的文档是id的1,2,3,4,5,假设调用如下:
POST http://{{elasticip}}:9200/{{index}}/_delete_by_query
尸体看起来怎么样?
编辑1:
根据@nitzien的回答,我尝试了以下两个电话:
POST http://{{elasticip}}:9200/{{index}}/_delete_by_query
{
"query": {
"ids" : {
"type" : "_doc",
"values" : ["1", "2", "3", "4", "5"]
}
}
}
以及
POST http://{{elasticip}}:9200/{{index}}/_delete_by_query
{
"query": {
"ids" : {
"type" : "_id",
"values" : ["1", "2", "3", "4", "5"]
}
}
}
然而,在这两种情况下,我得到
"deleted": 0"
在回应中。
DELETE
声明,一个接一个。
编辑2-问题已解决-此索引中的我的文档类型不是
_doc
是的
_ssldoc
因此,必须在@nitzien提供的查询中更新。把尼采的回答标为答案。谢谢。