As mentioned by @Elasticsearch Ninja you can use the alias, you can also use update by query API
Adding a working example
Index Mapping:
{
"mappings": {
"properties": {
"name": {
"type": "text"
}
}
}
}
Index Data:
{
"name":"John"
}
Update by Query API
POST /_update_by_query
{
"query": {
"bool": {
"must_not": {
"exists": {
"field": "title"
}
}
}
},
"script" : {
"inline": "ctx._source.title = ctx._source.name; ctx._source.remove("name");"
}
}
By the above query name
field name will be changed to title
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…