I want to create a script that boosts the scores of documents by a
computed amount. I want to boost the score, not replace it.
The code I tried looks like this (qb is a QueryBuilder built by
earlier code):
qb = new CustomScoreQueryBuilder(qb)
.lang("mvel")
.script("2");
The expected result is that this would multiply all the scores of the
results by 2. (I realize there are better ways to multiply by 2, but I
intend to replace the 2 with a more complex formula once I know it
works).
What happens, instead, is that all the scores for all the hits are set
equal to 2.
If I could access the original score and multiply it myself, I would
do so, but I tried using doc.score to access it and this didn't work
at all.
On Wednesday, January 25, 2012 at 11:27 PM, Frank LaRosa wrote:
Hi,
I want to create a script that boosts the scores of documents by a
computed amount. I want to boost the score, not replace it.
The code I tried looks like this (qb is a QueryBuilder built by
earlier code):
qb = new CustomScoreQueryBuilder(qb)
.lang("mvel")
.script("2");
The expected result is that this would multiply all the scores of the
results by 2. (I realize there are better ways to multiply by 2, but I
intend to replace the 2 with a more complex formula once I know it
works).
What happens, instead, is that all the scores for all the hits are set
equal to 2.
If I could access the original score and multiply it myself, I would
do so, but I tried using doc.score to access it and this didn't work
at all.
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.