I'm trying to do a custom score function in MVEL and need to learn how to
deal with a null value (ideally, the null value would not be there of
course!) but it's already in the index now:
I want to take my existing score and let's say e.g. divide it by a
particular document field value(checkVal( if available, 1 if not
From looking at:
I thought i could just say:
"script" : "_score * (doc['checkVal'].value==nil?1:doc['checkVal'].value)"
The problem is that documents that have a nil/null value seem to be ignored
and all others use the correct value. (the value gets used in the query
phase also - that is why i am using doc instead of source)
I've also tried null instead of null and have seen people talking about
'.?' as a value check also?