Hi,
Some basics in painless (the painful syntax)
Trying to update a filed to have the timestamp value + X hours.
I was trying the following
POST index*/_update_by_query
{
"script": {
"source": "ctx._source.timestamp_shifted = ctx._source.timestamp + 39600",
"lang": "painless"
},
"query": {
"term": {
"msg_source_type_name.keyword": "xxx"
}
}
}
POST index*/_update_by_query
{
"script": {
"source": "ctx._source.timestamp_shifted = ctx._source.timestamp.plusHours(11)",
"lang": "painless"
},
"query": {
"term": {
"msg_source_type_name.keyword": "xxx"
}
}
}
Anyone can point me to the right syntax?
Cheers!