http://localhost:9200/{index}/{type}/_update_by_query
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "combination"
}
}
}
},
"script": {
"inline": "ctx._source['combination'] = false"
}
}
POST /{index}/_update_by_query
{
"query": {
"bool": {
"must": [{
"term": {
"institutionId": 239
}
},
{
"term": {
"deleted": false
}
},
{
"terms": {
"category": [8, 9]
}
}
]
}
},
"script": {
"source": "ctx._source['isOutsideHospital'] = true;ctx._source['outsideCompany'] = 'xxx'"
}
}
POST /customer/_doc/1/_update?pretty
{
"doc": { "name": "Jane Doe", "age": 20 }
}
网友评论