doc_update_by_query
Update multiple documents in an Easysearch index using a query to specify which documents to modify, applying a script to change their fields.
Instructions
按查询更新文档
参数:
index: 索引名称
query: 查询条件(可选,不传则匹配所有)
script: 更新脚本
refresh: 是否刷新
示例:
doc_update_by_query("products",
query={"term": {"category": "electronics"}},
script={"source": "ctx._source.on_sale = true"}
)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | ||
| query | No | ||
| script | No | ||
| refresh | No |