SOLR-15873: factor out a ReRankRescorer class, simplify LTR[Interleaving]Rescorer code #478
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(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 therescore
method so thattopN == firstPassTopDocs.scoreDocs.length
is always the case.This pull request introduces a
ReRankRescorer
class for the specificReRankCollector
use case i.e. a two arguments API signature variantrescore(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 thetopN == firstPassTopDocs.scoreDocs.length
condition.Existing
LTR[Interleaving]Rescorer
APIs that supporttopN != 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.