SOLR-15437: ReRanking / LTR does not work in SolrCloud with custom sort by score #171
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.
https://issues.apache.org/jira/browse/SOLR-15437
Description
This Pr is based upon the changes made in #151.
So the base for this PR is a functioning ReRank / LTR in SolrCloud.
The problem that this PR wants to solve is, that the not-reRanked documents cannot be sorted by score.
The cause for this is, that the originalScore of a document gets overridden during ReRanking. Therefore we cannot access it if the document should no longer be reRanked after merging the results of multiple shards. (Because its reRanked score is too low for it to be placed under the number of documents that should be reRanked.)
Solution
Please note:
The code in this PR is a very rough draft. There are multiple FIXMEs and TODOs that still need to addressed. Also, I am not sure about the multisharding bahavior.
This is why this PR is a draft. It should serve as base to enable a better exchange about possible solutions.
We track the originalScore similar to the score. The originalScore never gets overridden. We can use it for the
queue
in theSortedHitQueueManager
.(More detail will follow.)
Tests
We made the test
testSimpleQueryCustomSortByScoreWithSubResultSetAndRowsLessThanExistingDocs
that checks that the documents that should not get reRanked are sorted by score.Multiple tests break!
The tests in
org.apache.solr.ltr
are green with changes inTestLTRReRankingPipeline.testDocParam()
.Tests in
org.apache.solr
:4115 tests run (I cancelled it)
3971 passes
seed: seed#[3DC97B489377F7B9]
tests failes 2:
Checklist
Please review the following and check all that apply:
main
branch. Attention! No, this is developed against the branch from SOLR-15437: ReRanking/LTR does not work in combination with custom sort and SolrCloud #151./gradlew check
.