I have been using the following query to rename fieldName.
POST http://localhost:9200/INDEX_NAME/_update_by_query
{
"query": {
"exists": {
"field": "NEW_FIELD_NAME"
}
},
"script" : {
"inline": "ctx._source.NEW_FIELD_NAME = ctx._source.OLD_FIELD_NAME; ctx._source.remove(\"OLD_FIELD_NAME\");"
}
}
But for more than 4.2 million data. It takes about 2-3 minutes.
Is there any way to reduce the duration?
The ElasticSearch version is 5.6.4