通过curl更新ES字段的json格式数据

    技术2022-07-10  151

    直接上样例吧:

    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格式数据

    Processed: 0.013, SQL: 9