After updating the ES to the newest version some of my runtime fields stop working, basically, the date.toString() doesn't work anymore to convert a date to a string.
Is there any option for this? I have been searching for hours in the release notes and I couldn't find anything regarding this.
This is my code:
{
"runtime": {
"dateAsString": {
"type": "keyword",
"script": """if (doc['date'].empty) {
emit('');
} else {
emit(doc['date'].value.toString('dd-MM-yyyy')); // this field is broken
}"""
},
"milage": {
"type": "keyword",
"script": """if (doc['end.odometer'].empty) {
emit('-');
} else {
emit(doc['end.odometer'].value.toString()); // this one works perfectly
}"""
}
}
}
The dashboards and indexes using the field dateAsString
are all broken, by doing some debug I kno for a fact that .toString()
works for the milage
field.