ElasticSearch7.6.2使用_update_by_query语法
将customer的值赋值为固定的值
POST log_info/_update_by_query
{"query":{"bool":{"filter":[{"range":{"createTime":{"from":"2021-03-17T00:00:00.000Z",
"to":"2021-03-17T23:59:59.000Z","include_lower":true,"include_upper":true,"boost":1.0}}},{"query_string":{"default_field":"systemCd.keyword","query":"test"}}],"adjust_pure_negative":true,"boost":1.0}},"script":{"inline": "ctx._source['customer'] = 'zhangsan01'"},"track_total_hits":2147483647}
将customer的值赋值为loginName的值
POST log_info/_update_by_query
{"query":{"bool":{"filter":[{"range":{"createTime":{"from":"2021-03-17T00:00:00.000Z",
"to":"2021-03-17T23:59:59.000Z","include_lower":true,"include_upper":true,"boost":1.0}}},{"query_string":{"default_field":"systemCd.keyword","query":"test"}}],"adjust_pure_negative":true,"boost":1.0}},"script":{"inline": "ctx._source['customer'] = ctx._source['loginName']"},"track_total_hits":2147483647}