On Thu, Jul 2, 2020 at 10:32 AM Diego Ceccarelli (BLOOMBERG/ LONDON) <
dceccarel...@bloomberg.net> wrote:

> Vincenzo, are you talking about
> https://lucene.apache.org/core/7_4_0/queries/org/apache/lucene/queries/CustomScoreQuery.html
> ?
>
>
Yep. I was just trying to figure it out how to port a class I have that
extends CustomScoreQuery to solr 8


> can you plug it in using a QueryParserPlugin?
>
> Yep, it's what I'm doing... Now I'm trying to move the code inside the Old
CustomScoreQuery->CustomScoreProvider.customScore()

I see the customScore() is executed for each document.

The documentation suggests to use FunctionScoreQuery and a
DoubleValuesSource.

So now I'm trying to create a custom DoubleValuesSource based on the old
class that extends CustomScoreQuery.
And inside my QueryParserPlugin, I have a Query that returns:

CustomDoubleValuesSource custom = new CustomDoubleValuesSource();
return new FunctionScoreQuery(query, custom);

If I'm doing right, the problem now is how to implement DoubleValuesSource

-- 
Vincenzo D'Amore

Reply via email to