Repository navigation
fix(retrievers): keep the filter on a Milvus hybrid search - #1175
Open
pcbeingused333 wants to merge 1 commit into
Open
pcbeingused333 wants to merge 1 commit into
pcbeingused333 wants to merge 1 commit into
Conversation
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.
The Milvus retriever drops
filterswhenever a text query is passed, which switches it to hybrid search.MilvusDocumentRetriever.rundid not forward them to_hybrid_retrieval, and that method had no way to apply them, so documents outside the filter were returned. The dense-only path was not affected._hybrid_retrievalnow acceptsfiltersand sets the built expression asexpron both the dense and the BM25AnnSearchRequest. With no filters,exprstaysNone.Compatibility
No change to saved workflows. The new argument is optional and added last. Hybrid searches with a filter configured now return only matching documents.
Verified
exprof both requests (with a filter,Noneand{}) and extended the retriever's hybrid test to pass a filter. The four cases fail without the change and pass with it.vectorstoresextra: 86 passed.tenantaandb) and a filtertenant == "a": on main the hybrid search returned both; with the change it returns onlya.black,isortandflake8on the changed files.This change was prepared with AI assistance.