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
.Net MEVD: Modify ITextSearch to react to the new LINQ-based vector search filtering #10456
ITextSearch accepts TextSearchOptions, which currently has an optional TextSearchFilter, which relies on the legacy non-LINQ vector search filtering feature. We need to modify it to use the new search interface. Mark Wallace (@markwallace-microsoft) let me know if/when you want to discuss ideas around this.
Issue #10456 Analysis: Modernize ITextSearch to Use LINQ-Based Vector Search Filtering
Context: What Are These Filtering Systems?
Both filtering systems serve the same purpose: allowing developers to narrow down search results based on metadata or record properties before performing the actual search operation.
Common Use Case: A knowledge base with documents containing metadata like category, department, confidentiality, and dateCreated. Developers need to filter searches like:
"Find 'API documentation' but only in technical documents"
"Search 'budget planning' but exclude confidential materials"
The Two Approaches:
Legacy (TextSearchFilter): Clause-based with method chaining: filter.Equality("category", "technical")
The LINQ approach provides compile-time safety, IntelliSense support, and complex boolean logic—which is why vector stores moved to it.
Overview
This document analyzes GitHub Issue #10456 which requests modernizing the ITextSearch interface to use LINQ-based filtering instead of the legacy TextSearchFilter approach.
Problem Statement
Current State: Inconsistent Filtering APIs
The Semantic Kernel .NET SDK currently has two different filtering systems:
Legacy Text Search Filtering (used by ITextSearch)
Activity
roji commentedon Mar 5, 2025
Mark Wallace (@markwallace-microsoft) just a reminder that this will need to happen at some point, not sure who's best for this...
.Net: Remove obsoleted MEVD APIs (#11891)
alzarei commentedon Sep 20, 2025
Hi Shay Rojansky (@roji), Mark Wallace (@markwallace-microsoft), Please let me know if I am on the right track for understanding and tackling this
Issue #10456 Analysis: Modernize ITextSearch to Use LINQ-Based Vector Search Filtering
Context: What Are These Filtering Systems?
Both filtering systems serve the same purpose: allowing developers to narrow down search results based on metadata or record properties before performing the actual search operation.
Common Use Case: A knowledge base with documents containing metadata like
category,department,confidentiality, anddateCreated. Developers need to filter searches like:The Two Approaches:
filter.Equality("category", "technical")doc => doc.Category == "technical" && doc.DateCreated > DateTime.Now.AddMonths(-6)The LINQ approach provides compile-time safety, IntelliSense support, and complex boolean logic—which is why vector stores moved to it.
Overview
This document analyzes GitHub Issue #10456 which requests modernizing the
ITextSearchinterface to use LINQ-based filtering instead of the legacyTextSearchFilterapproach.Problem Statement
Current State: Inconsistent Filtering APIs
The Semantic Kernel .NET SDK currently has two different filtering systems:
Legacy Text Search Filtering (used by
ITextSearch)TextSearchFilterwith clause-based filteringdotnet/src/SemanticKernel.Abstractions/Data/TextSearch/Modern Vector Search Filtering (used by vector stores)
Expression<Func<TRecord, bool>>dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/The Technical Debt
The current implementation in
VectorStoreTextSearch.csshows the problem:This code converts from the legacy
TextSearchFilterto the already-obsoleteVectorSearchFilter, rather than using the modern LINQ-based approach.Root Cause Analysis
Related Work: PR #10273
The foundation for LINQ-based filtering was established in PR #10273, which introduced:
VectorSearchOptions<TRecord>.Filterproperty usingExpression<Func<TRecord, bool>>VectorSearchFilterapproachHowever,
ITextSearchwas not updated to use this new infrastructure, creating the current inconsistency.Current Interface Design
ITextSearch Interface:
TextSearchOptions Class:
Versus Modern VectorSearchOptions:
Impact Assessment
Affected Components
Based on codebase analysis, the following components require updates:
Core Abstractions
ITextSearch.csTextSearchOptions.csTextSearchFilter.csImplementation Classes
VectorStoreTextSearch.cs- Primary implementationBingTextSearch.csGoogleTextSearch.csTavilyTextSearch.csBraveTextSearch.csTests and Samples
Breaking Change Analysis
This is a breaking change that requires careful migration strategy:
TextSearchOptions.Filtertype changes fromTextSearchFilter?toExpression<Func<TRecord, bool>>?ITextSearch<TRecord>)Verification: Issue Not Addressed Elsewhere
Checked Related PRs/Issues
ITextSearchCurrent Status
TextSearchFilterNext Steps
The solution requires:
References
Analysis completed on September 19, 2025
68 remaining items
.Net: fix: Remove OldFilter dependency from VectorStoreTextSearch (mi…
.Net: fix: Remove OldFilter dependency from VectorStoreTextSearch (#1… (
.Net: Add provider-specific search parameters to Bing/Google connecto…
.Net: Net: Address roji/westey review feedback round 2 on text search…
Remove legacy filtering from MEVD providers
Remove legacy filtering from MEVD providers
Remove legacy filtering from MEVD providers
Remove legacy filtering from MEVD providers
Remove legacy filtering from MEVD providers
.Net: Remove legacy filtering from MEVD providers (#13636)