lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ankit Singh <an...@zettata.com>
Subject Changing scoring in RankQuery
Date Fri, 15 Jul 2016 12:07:52 GMT
Hi,

I am trying to understand how to influence scoring via RankQuery in solr >=
4.9. My requirements are two fold:

1) Use a custom collector
2) Change scoring of docs

As far as i could understand, if we just want to change the scoring, we can
write a QueryParserPlugin and extend CustomScoreQuery to introduce a
CustomScoreProvider and modify the customScore method so that whenever we
call scorer.score(), this new custom scorer would be used. This works
perfectly in isolation (not using RankQuery).

However, i want to use a custom scorer in my query object extending
RankQuery (where i am setting a custom collector). One way to do this is to
override the setScorer method and initialise an object of the new scorer
here. The problem i'm experiencing here is that to modify the scoring
explanation, i would need to rewrite the weight class which is one
complexity i am trying to avoid. I would need the same scorer in a
post-filter i wrote, and going by this method, i would need to set the
scorer even in the post-filter.

Is there another way to change scoring of docs while also using RankQuery
API, which lets us change the explanation in an easier way?

Regards,
Ankit Singh

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message