Improve low-limit search results #789
Draft
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.
Purpose of the change
When search limit is very low e.g. 1-3, and/or episodes are very small e.g. on the order of 0-50 characters, returned results are likely to be terrible because the episode budget is filled based on weighted index proximity instead of relevance.
Description
The current implementation fills up the return limit budget by taking the episodes closest to the nuclear episode first. When a good episode happens to be part of the context of a bad nuclear episode, it is possible that the reranker gives a high score to the context belonging to the bad nuclear episode, so that the good episode is not included.
This is an easy issue to hit especially in contrived scenarios where consecutive episodes are likely to be unrelated.
Discovered by #771 failing integration tests.
Just rank individual episodes when the search limit is low.
Type of change
[Please delete options that are not relevant.]
How Has This Been Tested?
Checklist
Maintainer Checklist