直接上樣例吧:
curl -X POST "10.101.36.106:9200/anti_documentcontent_v2_20200630/_update_by_query?pretty" -H 'Content-Type: application/json; charset=UTF-8' -d'
{
"query": {
"term": {
"sequenceId": "20200630011435061940"
}
},
"script": {
"source": "ctx._source.lqBodyText=params.paramLqBodyText;ctx._source.hmlqBodyText=params.paramHmlqBodyText",
"params": {
"paramLqBodyText": "{\"action\":0,\"documentLowQualityLabelDetails\":[{\"labelStr\":\"normal\",\"label\":0,\"score\":0.0}]}",
"paramHmlqBodyText": "{\"action\":0,\"documentLowQualityLabelDetails\":[{\"labelStr\":\"normal\",\"label\":0,\"score\":0.0}]}"
}
}
}
'
說明:更新記錄爲sequenceId=20200630011435061940的數據
修改字段lqBodyText 和 hmlqBodyText,這兩個字段都是json格式數據