Skip to content

Python: Support BetweenFilterClause or RangeFilterClause for Redis #10391

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

Open
moonbox3 opened this issue Feb 4, 2025 · 5 comments
Open

Python: Support BetweenFilterClause or RangeFilterClause for Redis #10391

moonbox3 opened this issue Feb 4, 2025 · 5 comments
Assignees
Labels
memory connector .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)

Comments

@moonbox3
Copy link
Contributor

moonbox3 commented Feb 4, 2025

There's a request extend our current FilterClauseBase, which only has EqualTo and AnyTagsEqualTo. We can do this by creating a new filter clause, like BetweenFilterClause or RangeFilterClause.

This also means we should extend the VectorSearchFilter (or SearchFilter) to allow .between(...).

The original ask is for Redis, but we should support this for others, too, if possible. For Redis we need to update _filters_to_redis_filters.

Tagging @westey-m for visibility for comments related to if there is (planned) support in .Net.

@moonbox3 moonbox3 added memory connector python Pull requests for the Python Semantic Kernel labels Feb 4, 2025
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Feb 4, 2025
@github-actions github-actions bot changed the title Python: Support BetweenFilterClause or RangeFilterClause for Redis .Net: Python: Support BetweenFilterClause or RangeFilterClause for Redis Feb 4, 2025
@westey-m
Copy link
Contributor

westey-m commented Feb 4, 2025

@moonbox3, in .net we are looking into using linq for expressing filters, which removes the need for a custom expression tree using filter clauses. Linq is a .net concept though, so not applicable to python. See #10156

Certainly more filter clauses are required beyond what we support today though. They were only intended to be the bare minimum to ship our preview and adding support for not, nesting, or, range filters, etc. will be important.

@sphenry sphenry assigned sphenry and eavanvalkenburg and unassigned sphenry Feb 4, 2025
@sphenry sphenry removed the triage label Feb 4, 2025
@sphenry sphenry moved this to Backlog: Not Planned in Semantic Kernel Feb 4, 2025
@moonbox3 moonbox3 changed the title .Net: Python: Support BetweenFilterClause or RangeFilterClause for Redis Python: Support BetweenFilterClause or RangeFilterClause for Redis Feb 5, 2025
@evchaki evchaki added the sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community) label Feb 6, 2025
@lohithgn
Copy link

@moonbox3 I see the issue title is set to Python. Will this issue track only for Python. I was porting a movie recommender example written in python to .NET using SK. The python example has a date range search for movies using vector. i need the filter in .NET. how will this make it to .NET SK?

@eavanvalkenburg
Copy link
Member

eavanvalkenburg commented Feb 15, 2025

@lohithgn for.net they have already added some new capabilities for this, @westey-m and @roji can comment!

@roji
Copy link
Member

roji commented Feb 15, 2025

@lohithgn yeah, as @eavanvalkenburg noted above considerable work has recently gone into augmenting the .NET filtering story, by using LINQ; see issue #10156 (and PR #10273 which was very recently merged). Date range search is something that's still on my todo to properly test, but the infrastructure is there for expressing any sort of filter.

@lohithgn
Copy link

@roji do i need to be on latest of Redis connector nuget to get the infra you are talking about? Any code examples i can see..
My scenario is simple - when i am doing vector search, i want to pass filter like genre=familyy, year = 1970 to 2017.
thoughts?

@eavanvalkenburg eavanvalkenburg moved this from Backlog: Not Planned to Backlog: Planned in Semantic Kernel Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory connector .NET Issue or Pull requests regarding .NET code python Pull requests for the Python Semantic Kernel sk team issue A tag to denote issues that where created by the Semantic Kernel team (i.e., not the community)
Projects
Status: Backlog: Planned
Development

No branches or pull requests

8 participants