Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-15873: factor out a ReRankRescorer class, simplify LTR[Interleaving]Rescorer code #478

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cpoerschke
Copy link
Contributor

(Keeping this PR as "draft" whilst the "keep or not keep" discussion in SOLR-15873 is underway and also because this PR includes the #470 changes.)

https://issues.apache.org/jira/browse/SOLR-15873

The Lucene Rescorer.rescore API signature takes three arguments: rescore(IndexSearcher searcher, TopDocs firstPassTopDocs, int topN)

The Solr ReRankCollector caps the number of documents that are passed to the rescore method so that topN == firstPassTopDocs.scoreDocs.length is always the case.

This pull request introduces a ReRankRescorer class for the specific ReRankCollector use case i.e. a two arguments API signature variant rescore(IndexSearcher searcher, TopDocs firstPassTopDocs) with non-support of the three argument variant.

Then the LTR[Interleaving]Rescorer logic can then be simplified by making use of the topN == firstPassTopDocs.scoreDocs.length condition.

Existing LTR[Interleaving]Rescorer APIs that support topN != firstPassTopDocs.scoreDocs.length are retained with @deprecated annotation for backwards compatibility and with the intention to remove them in the next or a subsequent Solr version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant