Hello every one,
I want to replace 3 fields that contains string(date) , string(time) and string(tz) by a new field with date type that contains (date+time+tz) converted.
{
"query":{
"bool":{
"must_not":{
"exists":{
"field":"new_date"
}
}
}
},
"script":{
"inline":"ctx._source.new_date = ctx._source.date + ctx._source.time + ctx._source.tz",
"lang":"groovy"
}
}
When i apply this , i got :
{
"error": {
"root_cause": [
{
"type": "script_exception",
"reason": "error evaluating ctx._source.new_date = ctx._source.date + ctx._source.time + ctx._source.tz",
"script_stack": [],
"script": "",
"lang": "groovy"
}
],
"type": "script_exception",
"reason": "error evaluating ctx._source.new_date = ctx._source.date + ctx._source.time + ctx._source.tz",
"caused_by": {
"type": "null_pointer_exception",
"reason": "Cannot execute null+null"
},
"script_stack": [],
"script": "",
"lang": "groovy"
},
"status": 500
}
This is the string one , Now how can i convert This to timestamp
Thank you for your help