I'm strugling with this compilation code:
[esn1] failed to load/compile script [day]: {
"type" : "script_exception",
"reason" : "compile error",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "invalid sequence of tokens near ['DateTime'].",
"caused_by" : {
"type" : "no_viable_alt_exception",
"reason" : null
}
},
"script_stack" : [
"def opDate = new DateTime(doc[params.field ...",
" ^---- HERE"
],
"script" : "def opDate = new DateTime(doc[params.field].date);opDate.getDayOfMonth();",
"lang" : "painless"
}
I'm trying to translate a groovy script to painless script. I'm trying to get day of a month
of a date.
My groovy script is:
def opDate = new DateTime(doc[params.field].date);opDate.getDayOfMonth();
How could I "translate" it?
Thanks.