lucene-java-user mailing list archives

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

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

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:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message