I am attempting to write a transformation while using the _reindex API. The idea is that I'm taking an existing index, I want to reindex it and append a number to the end of a few hash string parameters in the process (type string). Is this a viable solution to do that?
POST <index>/<index_type>/_reindex
{
"source": {
"index": "<index_name>"
},
"dest": {
"index": "<new_index_name>",
},
"script": {
"source": "ctx._source.bene_acc_no += '21' ",
"source" : "ctx._source.orig_acc_no += '21' ",
"source" : "ctx._source.owner_acc_no += '21' "
}
}
Or can I simply use "source" : "ctx._source.owner_acc_no++"
?
Finally, do I have to worry about mapping with reindexing, or can I assume this will be done automatically when reindexing.
Thank you in advance.