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-15437: ReRanking / LTR does not work in SolrCloud with custom sort by score #171

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

Conversation

tomglk
Copy link
Contributor

@tomglk tomglk commented Jun 10, 2021

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 the SortedHitQueueManager.
(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 in TestLTRReRankingPipeline.testDocParam().

Tests in org.apache.solr:
4115 tests run (I cancelled it)
3971 passes
seed: seed#[3DC97B489377F7B9]
tests failes 2:

  • org.apache.solr.handler.component.DistributedQueryComponentReRankTest
  • org.apache.solr.search.MergeStrategyTest

Checklist

Please review the following and check all that apply:

@tomglk tomglk marked this pull request as draft June 10, 2021 11:22
@janhoy janhoy changed the title Solr 15437: ReRanking / LTR does not work in SolrCloud with custom sort by score SOLR-15437: ReRanking / LTR does not work in SolrCloud with custom sort by score Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants