The requested URL was not found on this server. 不管你信不信,反正我是没找到

es7.1es 批量更新字段值报错

Elasticsearch | 作者 jhondom | 发布于2020年08月06日 | 阅读数:1916

es7.1:项目需要批量更新字段的值报错,使用脚本:
POST index/demp_search_202004/_update_by_query
{
  "script": {
    "lang": "painless",
    "inline": "if(ctx._source.policyType== '1'){ctx._source.policyType= '01'}  if(ctx._source.policyType== '2'){ctx._source.policyType= '02'}"
  }
}
报错信息:

企业微信截图_1596635270496.png

根据报错信息,是version冲突了。请教各位老师有说明办法可以批量更新线上的某个字段的值。
 
已邀请:

byx313 - BLOG:https://www.jianshu.com/u/43fd06f9589c

赞同来自: jhondom

POST test/_update_by_query
{
"script": {
"lang": "painless",
"source": "if(ctx._source.age== 29){ctx._source.age= 30}"
}
}
我测试了是可以的。v7.8

FFFrp

赞同来自:

_update_by_query?conflicts=proceed
看下文档的这个

要回复问题请先登录注册