网上查的,一堆赋值粘贴,要么就是驴唇不对马嘴的

需求是,我要手动更新状态值,但不想把之前的索引删掉

 

参考文档:​​https://www.elastic.co/guide/en/elasticsearch/reference/7.1/docs-update-by-query.html​

 

 

Elasticsearch 7.1 更改字段的值, 更改自定义字段的值_elasticsearch

 

 

 

附带一个查询:

# 查找内容并过滤 高亮
GET /job_name/_search
{
"_source": false,
"query" : {

"bool": {
"must": [
{ "match_phrase": {
"content" : "my text"
}}
],
"filter": [
{ "term": { "external.status": 10 }}
]
}
},

"highlight": {
"fields" : {
"content" : {}
}
}
}