I am trying to reindex an index and trying to create new field from two object fields.
I am not able to access the field value latitude and it is returning null.
code below
POST _reindex
{
"source": {
"index": "append7"
},
"dest": {
"index": "append8"
},
"script": {
"source": "ctx._source['NEW'] = ctx._source['a.b.latitude'] + ',' + ctx._source['a.b.longitude]",
"lang": "painless"
}
}
My _source shows like this:
"a":{
"b":{
"latitude":"42.00",
"longitude":"74.32"
}
}