I am trying to concat 2 fields using painless script during ReIndex API call. However not able to get the correct syntax.
field3=field1,field2. The below code is throwing a parsing exception
POST _reindex
{
"source": {
"index": "sourceIdx",
"type": "sourxeType"
},
"dest": {
"index": "destinationIdx"
},
"script": {
"source": "ctx._source.field3=
ctx._source.field1 + ',' + ctx._source.field2",
"lang": "painless"
}
}