[英]get updated doc ids in Elasticsearch's update_by_query api
I use the following query to update some weight filed in matched docs.我使用以下查询来更新匹配文档中的一些权重。 I need to get the list of updated docs id but I don't know how to do that?
我需要获取更新的文档 ID 列表,但我不知道该怎么做?
POST v1_shingle_analyzer/_update_by_query
{
"script" : {
"source": "ctx._source.content_completion.weight ++",
"lang": "painless",
"_source":true,
"_source_includes":"_id"
},
"query": {
"ids": {
"values": ["ad22784cde0cecab176811ca9d77e7c2","dssdg784cde0cecab176811ca9fgdfg"]
}
}
}
References this , this legend answer , this plugin and few ES forum posts, JIRAs.参考这个, 这个传说的答案,这个插件和一些 ES 论坛帖子,JIRA。
Short answer:简短的回答:
There is no direct way of doing this.没有直接的方法可以做到这一点。 You may need to query again with the
IDs
to check whether it changed.您可能需要再次查询
IDs
以检查它是否已更改。
Detailed answer:详细解答:
As per the documentation , Response doesn't have a field to return the updated IDs
.根据文档, Response 没有返回更新后的
IDs
的字段。
The plugin mentioned is deprecated/dropped the support to context as per the GitHub
link.根据
GitHub
链接,提到的插件已弃用/放弃对上下文的支持。 But I think that但我认为
IDs
updated If it really matters.IDs
的方法。 Kindly let me know for more information.请让我知道更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.