Qdrant filtering methods
Feature request
The qdrant vector store has "must" in filter, is it possible to add "must_not" and/or "should" as well?
Ref: https://qdrant.tech/documentation/filtering/
Motivation
Having a filter is really nice, but its hard to use row level authorization without "must_not"
So we can say "must" include ID and "must_not" include ID2
To be able to filter correctly
Your contribution
I am a front-end developer, and hoping someone with python competance can handle this.
What if you changed the API so a user passes the rest.Filter directly (instead of MetadataFilter)? This way, you won't need to implement different filtering options (must, must_not, nested, etc.)
Qdrant documentation shows how to do that and gives Python examples anyways...
I also faced an issue when trying to do filtering with qdrant. Here is how I solved it temporarily. (#5073 ) It should allow you to pass any filters provided by qdrant. Just copy paste their python examples.
@dagthomas @hp0404 @YLFxGen This has been implemented in #5446.
@dagthomas @hp0404 @YLFxGen This has been implemented in #5446.
Great job, thank you!
Hi, @dagthomas! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.
From what I understand, you requested the addition of "must_not" and/or "should" filtering methods to the qdrant vector store for more flexible filtering and row level authorization. There have been some discussions and suggestions in the comments, including changing the API to pass the rest.Filter directly instead of MetadataFilter. YLFxGen also shared a temporary solution for filtering with qdrant.
However, it seems that the feature you requested has already been implemented in issue #5446, which received positive reactions from hp0404 and yourself.
Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.
Thank you for your contribution to the LangChain repository!