_update_by_query

 POST cq-tbpitem/_update_by_query
{
  "script": {
   // "source": "ctx._source.CUSTOMID='2700011';ctx._source.DWBM='1234' ", //更新多个字段
"source": "ctx._source.testupdate=ctx._source.CUSTOMID+'|'+ctx._source.REPORTNUM ",
    "lang": "painless"
  },
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "CUSTOMID": {
              "value": "1800621"
            }
          }
        },
        {
          "wildcard": {
            "SYSPRIMARYKEY": {
              "value": "*AA*"
            }
          }
        }
      ]
    }
  }
}

posted on 2018-05-04 15:11  zhangfeitaimengle  阅读(286)  评论(0编辑  收藏  举报

导航