You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: InMemoryCollection combines multiple search filters with OR instead of AND #14538
VectorSearchOptions documents that "When multiple filters are used, they are combined with an AND operator" (python/semantic_kernel/data/vector.py, class VectorSearchOptions). InMemoryCollection combines a list of filters with OR instead.
A record is kept as soon as any one filter matches. Every other connector (Postgres " AND ", Chroma $and, Mongo $and, Qdrant must, Weaviate all_of, Redis &, Azure AI Search " and ") uses AND.
Expected: ['2'] (red AND size > 5).
Actual: ['1', '2', '4'] (red OR size > 5).
The same happens when the filters are lambdas instead of strings.
Impact
Any multi-filter search against the in-memory store returns records that violate part of the filter. Code that works on a real store returns extra results here, and tests written against the in-memory store give wrong results.
I have a fix ready (all(...) over the filters) with tests, and will open the PR right away.
Activity