Rejecting mapping update

I guess the below link has helped me a ton.

I tried creating the index with different type as it was mapped in my index. But was ending up in confusions.
But below reindex api helped me to have single t type.

POST _reindex
{
"source": {
"index": "old"
},
"dest": {
"index": "new"
},
"script": {
"source": """
ctx._source.type = ctx._type;
ctx._type = 'doc';
""",
"lang": "painless"
}
}

Thanks a ton again