lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MarcoR <grumpyrodrig...@protonmail.com>
Subject How can I use FunctionScoreQuery to replace CustomScoreQuery?
Date Sat, 26 Jan 2019 16:01:37 GMT
Hi, 

Based on everything I read so far, FunctionScoreQuery is the way forward for
boosting. 

My problem is, even though CustomScoreQuery's documentation suggests that
FunctionScoreQuery should be used instead, I cannot find a way to use
FunctionScoreQuery in the same way I can use CustomScoreQuery. 

Specifically, getCustomScopeProvider method of FunctionScoreQuery allows me
to provide custom score logic which provides access to document identifier,
which then lets me apply document specific logic. 

I could not find a way to do the same using FunctionScoreQuery. I looked at
various ways of building a DoubleValuesSource but I simply got lost in the
documentation and codebase. My guess is there should be a way to wrap the
per document scoring logic as a DoubleValuesSource. Am I right? If so, what
is the approach I should use? 

I have a case in which I can use a phrase query to match documents of
interest but then I'd like to change their scores based on complex logic
that lucene-expression would not be sufficient for. 

I want to use a FunctionScoreQuery to avoid use of an obselete query type,
but I'm stuck. 







--
Sent from: http://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message