我需要在索引中的所有文档中添加一个新字段,而不需要下拉文档并将其推回(这将需要大约一天)。 是否可以使用_BULK api来实现这一目标?
我还研究过update_by_query插件,它似乎只需要将它们拉下来并自己推回它们。
I need to add a new field to ALL documents in an index without pulling down the document and pushing it back up (this will take about a day). Is it possible to use the _BULK api to achieve this?
I have also researched the update_by_query plugin, and it seems to would take just as long as pulling them down and pushing them back myself.
最满意答案
是的,批量API支持可以使用部分文档或脚本添加新字段的更新 。 要遍历文档ID,请执行扫描并滚动 ,并将fields参数设置为空数组。
Yes, the bulk API supports updates which can add a new field using a partial document or script. To iterate through your document ids do a scan and scroll with the fields parameter set to an empty array.
更多推荐
发布评论