gpt4 book ai didi

elasticsearch - Elasticsearch 2.3-通过查询删除文档

转载 作者:行者123 更新时间:2023-12-02 22:50:00 25 4
gpt4 key购买 nike

我正在使用Elasticsearch 2.3和Sense,并尝试通过查询删除文档。

我引用这些文档:
https://www.elastic.co/guide/en/elasticsearch/plugins/current/delete-by-query-usage.html

请求

DELETE /monitors/monitor/_query
{
"term": { "ProcessName" : "myProcName" }
}

响应
{
"found": false,
"_index": "monitors",
"_type": "monitor",
"_id": "_query",
"_version": 11,
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
}
}

如您所见,即使我将ProcessName命名为“myProcName”,也无法获得任何结果。
响应还表明引擎查找的 _id等于 _query

编辑1:
即使发送请求:
DELETE /monitors/monitor/_query
{
"query": {
"term": { "ProcessName" : "tibapp_qflowfile" }
}
}

我得到回应:
{
"found": false,
"_index": "monitors",
"_type": "monitor",
"_id": "_query",
"_version": 1,
"_shards": {
"total": 2,
"successful": 1,
"failed": 0
}
}

最佳答案

您得到的输出表示您尚未安装“按查询删除”插件,默认情况下未安装该插件。

Do that first,重新启动您的节点,此后它将起作用

bin/plugin install delete-by-query

关于elasticsearch - Elasticsearch 2.3-通过查询删除文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36563687/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com