删除Elasticsearch文档中的字段

from https://cinhtau.net/2017/09/01/remove-field-from-elasticsearch-document/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
POST /test_index/log/_update_by_query
{
"script": {
"inline": "ctx._source.remove('source_type')",
"lang": "painless"
},
"query": {
"bool": {
"must": [
{
"exists": {
"field": "source_type"
}
}
]
}
}
}
分享