我想从索引中删除多个字段,例如 ('person_full','company_full')。使用ES: 5.6.14
删除一个字段 -> 以下代码运行良好
POST firma-2019.04/_update_by_query?conflicts=proceed
{
"script": {
"source": "ctx._source.remove('person_full')",
"lang": "painless"
}
}
Run Code Online (Sandbox Code Playgroud)
但我想一次删除多个字段,此代码不起作用。
POST firma-2019.04/_update_by_query?conflicts=proceed
{
"script": {
"source": "ctx._source.remove('person_full','company_full')",
"lang": "painless"
}
}
Run Code Online (Sandbox Code Playgroud)
预先感谢您的帮助
以下查询应该有效:
POST firma-2019.04/_update_by_query?conflicts=proceed
{
"script": {
"source": "ctx._source.remove('person_full');ctx._source.remove('company_full')",
"lang": "painless"
}
}
Run Code Online (Sandbox Code Playgroud)
要删除更多字段,请在脚本中添加更多 remove 语句。
| 归档时间: |
|
| 查看次数: |
2956 次 |
| 最近记录: |