-
Notifications
You must be signed in to change notification settings - Fork 117
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
feat: Add filter_policy init parameter to all retrievers #781
Conversation
@silvanocerza we also need to address retrievers in Haystack project itself. I suppose we need to somehow coordinate this PR and that one and their releases? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please break this down into single PRs for single integrations? This will make rolling out these changes with appropriate releases for the single packages easier, as well as producing better release notes.
Why:
The changes across various integrations (Astra, Chroma, Elasticsearch, MongoDB Atlas, OpenSearch, pgvector, Pinecone, Qdrant, and Weaviate) address a common need for more flexible filtering options within the retrieval process. By introducing a filter policy option (
replace
ormerge
), developers can now control how runtime filters are applied relative to initialization time filters.filter_policy
init parameter to all retrievers #780What:
filter_policy
parameter with optionsreplace
andmerge
across multiple retrievers to control filter behavior dynamically.filter conservatively
policy behavior.How can it be used:
Dynamic Filter Behavior Adjustment: Users can decide whether to completely override the initial filters set during the retriever's initialization (
replace
) or merge them with runtime filters, with the latter taking precedence (merge
).Complex Search Scenarios:
merge
option allows for an additive approach.replace
option offers a clean slate for filters at runtime.How did you test it:
replace
andmerge
scenarios for thefilter_policy
parameter.Notes for the reviewer:
replace
to maintain current behavior unless explicitly set tomerge
.