.Net: fix: Remove OldFilter dependency from VectorStoreTextSearch (#1…#13564
Merged
markwallace-microsoft merged 1 commit intomicrosoft:feature-text-search-linqfrom Feb 19, 2026
Conversation
4 tasks
…crosoft#10456) Address @roji's feedback on PR microsoft#13384: convert legacy ITextSearch path from using VectorSearchFilter.OldFilter to building LINQ expression trees via BuildFilterExpression(), enabling MEVD to drop OldFilter before 1.0 releases. - Replace OldFilter with BuildFilterExpression() in legacy ExecuteVectorSearchAsync - Use PropertyInfo overload of Expression.Property() to avoid IL2026 trimming warning - Update ADR-0065: correct Option 2 rejection rationale (tree building != compiling) - Update ADR-0065: architecture diagram shows both paths converge on VectorSearchOptions.Filter
f844a4e to
9df93e3
Compare
roji
approved these changes
Feb 19, 2026
86e5ce7
into
microsoft:feature-text-search-linq
10 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
.Net: fix: Remove OldFilter dependency from VectorStoreTextSearch (#10456)
Addresses @roji's feedback on PR #13384: Remove the dependency on MEVD's obsolete
OldFilterproperty fromVectorStoreTextSearch, enabling MEVD to dropOldFilterbefore publishing 1.0 provider versions.Motivation and Context
Why is this change required?
@roji identified that
VectorStoreTextSearch's legacy path handsFilterClausevalues directly to MEVD viaOldFilter, which means MEVD cannot removeOldFilterwhile that dependency exists. His priority is to removeOldFilterfrom MEVD before publishing 1.0 versions of most providers — an[Obsolete]property on a 1.0 API is undesirable.What problem does it solve?
OldFilterpropertyOldFilterindependently, unblocking 1.0 provider releases#pragma warning disable CS0618suppressions forOldFilter/VectorSearchFilterusageWhat scenario does it contribute to?
Unblocks MEVD 1.0 provider releases by removing the coupling between SK's legacy text search path and MEVD's obsolete filtering API.
Issue Link: #10456
Description
Code Change:
VectorStoreTextSearch.csReplaced the legacy path's
OldFilterassignment with a newBuildFilterExpression()method that convertsFilterClausevalues to a LINQ expression tree:Before:
After:
BuildFilterExpression()details:FilterClauseinstances, currently handlingEqualToFilterClause(the only typeTextSearchFilterproduces)PropertyInfoviatypeof(TRecord).GetProperty()(trim-safe becauseTRecordhas[DynamicallyAccessedMembers(PublicProperties)]), buildsExpression.Property→Expression.Equal→Expression.AndAlsoPropertyInfooverload ofExpression.Property()to avoidIL2026trimming warning (thestringoverload has[RequiresUnreferencedCode])Expression<Func<TRecord, bool>>ornullif no clausesNotSupportedExceptionfor unsupported clause types,InvalidOperationExceptionfor missing propertiesAOT compatibility: Building expression trees (
Expression.Property,Expression.Equal,Expression.Lambda) is pure data-structure construction — fully AOT-compatible. MEVD'sVectorSearchOptions<TRecord>.Filteranalyzes the tree without callingExpression.Compile().ADR Update:
0065-linq-based-text-search-filtering.mdBuildFilterExpression()converting clauses to LINQ trees, both paths converging onVectorSearchOptions.FilterVectorSearchOptions.FilterRequiresDynamicCodewould cascade; in fact, onlyExpression.Compile()requires dynamic code, not tree construction. Added update note explaining the distinction.Contribution Checklist
Validation
dotnet format --verify-no-changes)dotnet build --configuration Release --warnaserror)SemanticKernel.UnitTests)dotnet publish --configuration Release, net9.0)dotnet publish --configuration Release, net10.0)