Hi there
I would like to run the following script with a function score query:
"return _score / max_score;"
However i'm getting the following result:
{
"error": {
"root_cause": [
{
"type": "script_exception",
"reason": "compile error",
"script_stack": [
"return _score / max_score;",
" ^---- HERE"
],
"script": "return _score / max_score;",
"lang": "painless"
}
],
"type": "script_exception",
"reason": "compile error",
"caused_by": {
"type": "illegal_argument_exception",
"reason": "Variable [max_score] is not defined."
},
"script_stack": [
"return _score / max_score;",
" ^---- HERE"
],
"script": "return _score / max_score;",
"lang": "painless"
},
"status": 500
}
Is it actually possible to use max_score inside a script ? If so, what could I be doing wrong here?
Thanks!