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
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?
On Wednesday, October 24, 2012 1:18:10 PM UTC-4, Derry O' Sullivan wrote:
Hi all,
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
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?
On Wednesday, October 24, 2012 1:18:10 PM UTC-4, Derry O' Sullivan wrote:Hi all,
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
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?
On Wednesday, October 24, 2012 1:18:10 PM UTC-4, Derry O' Sullivan
wrote:Hi all,
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
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?
On Wednesday, October 24, 2012 1:18:10 PM UTC-4, Derry O' Sullivan
wrote:Hi all,
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
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.