Fix: #2577 - IllegalArgumentException when using findAndRerank without specifying $vector/$vectorize - #2584
Open
sl-at-ibm wants to merge 2 commits into
Open
Fix: #2577 - IllegalArgumentException when using findAndRerank without specifying $vector/$vectorize#2584sl-at-ibm wants to merge 2 commits into
sl-at-ibm wants to merge 2 commits into
Conversation
Closed
2 tasks
Contributor
Unit Test Coverage Report
|
Contributor
📉 Integration Test Coverage Delta vs Main Branch (dse69-it)
|
Contributor
Integration Test Coverage Report (dse69-it)
|
amorton
reviewed
Sep 21, 2026
| INVALID_CREATE_COLLECTION_FIELD, | ||
| INVALID_RERANK_OVERRIDE, | ||
| MISSING_RERANK_QUERY_TEXT, | ||
| MISSING_VECTOR_OR_VECTORIZE_IN_HYBRID_SORT, |
Contributor
There was a problem hiding this comment.
this is an error in the sort clause, we should put the error in that class. Will do a longer review later today
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does:
Replaces a naked
IllegalArgumentException / Unexpected server erroroccurring when a findAndRerank command lacks a prescription on how to run the vector leg, explicitly or implicitly (i.e. no$vector/$vectorizein the sort clause and no shorthand$hybrid: <string>form for sort).Which issue(s) this PR fixes:
Fixes #2577 .
Notes:
This PR replaces #2579 , which is going to be closed after discussion (that one approached this problem by enabling a no-vector/ize findAndRerank, which was later clarified to not be in scope).
Note also that this PR does not simply replace the generic naked error with throwing the user-friendly new exception added to
errors.yaml. Rather, it moves such validation up in the chain, so that the missing vector prescription is detected and thrown first, before "secondary" problems (such as, missing rerankOn) are detected. This, I believe, improves the experience of a developer approaching this command.As a last point, I have added unit tests around the various findAndRerank call pattern that are supposed to trigger this error, as well as a few cases where the command should succeed. Given the intricacies of this API command, and the fact that clarifications were needed a few times around its exact behaviour, I deemed it reasonable to try and have the test be more prescriptive about the expected constraints of this command.
Checklist