I would like to remove multiple fields from index for example ('person_full','company_full'). Using ES: 5.6.14
To delete one field -> following code is working well
POST firma-2019.04/_update_by_query?conflicts=proceed
{
"script": {
"source": "ctx._source.remove('person_full')",
"lang": "painless"
}
}
But I would like to delete multiple fields at once and this code does not work.
POST firma-2019.04/_update_by_query?conflicts=proceed
{
"script": {
"source": "ctx._source.remove('person_full','company_full')",
"lang": "painless"
}
}
Thank you in advance for your Help
The below query should work:
POST firma-2019.04/_update_by_query?conflicts=proceed
{
"script": {
"source": "ctx._source.remove('person_full');ctx._source.remove('company_full')",
"lang": "painless"
}
}
To delete more fields add more remove statements in the script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With