You can see how DoubleValuesSource.FieldValuesSource reads numeric field. Custom code can read string identifier, and run custom logic, then it can wrap a query with FunctionScoreQuery.boostByValue(Query, DoubleValuesSource).
On Sat, Jan 26, 2019 at 7:01 PM MarcoR <grumpyrodrig...@protonmail.com> wrote: > 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-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > -- Sincerely yours Mikhail Khludnev