I am looking at elasticsearch's documentation for how to create a script for a custom score function which uses fields that are not queried for scoring at this link.
From what I can see you build a script function like so:
"script_score" : {
"script" : {
"lang": "painless",
"inline": "_score * doc['my_numeric_field'].value"
}
}
but I am wondering what is the syntax for replacing doc['my_numeric_field'].value if it is missing?
cannot convert MethodHandle(Doubles)double to (Object)booleanwhen I try to use ternary operatorsfloat_can_be_null ? float : some_default