向弹性搜索索引中的所有文档批量添加新字段
Bulk add new field to ALL documents in an elasticsearch index
我需要向索引中的所有文档添加一个新字段,而无需下拉文档并将其重新推回(这将需要大约一天的时间)。是否可以使用 _BULK api 来实现此目的?
我也研究过update_by_query这个插件,好像自己拉下来推回去就可以了
是的,批量 API 支持 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 参数设置为空数组。
我需要向索引中的所有文档添加一个新字段,而无需下拉文档并将其重新推回(这将需要大约一天的时间)。是否可以使用 _BULK api 来实现此目的?
我也研究过update_by_query这个插件,好像自己拉下来推回去就可以了
是的,批量 API 支持 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 参数设置为空数组。