Document WithApproximate LINQ operator for SQL Server vector search#5346
Merged
roji merged 2 commits intodotnet:preview.5from Apr 28, 2026
Merged
Document WithApproximate LINQ operator for SQL Server vector search#5346roji merged 2 commits intodotnet:preview.5from
roji merged 2 commits intodotnet:preview.5from
Conversation
Document dotnet/efcore#38144 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates EF Core documentation to match the updated SQL Server vector search LINQ surface, replacing the topN parameter with a composable OrderBy(...).Take(...).WithApproximate() pattern for ANN queries over VECTOR_SEARCH().
Changes:
- Update EF Core 11 “What’s new” content to show
Take()+WithApproximate()usage and explain exact vs approximate modes. - Restructure the SQL Server vector search provider doc to distinguish exact kNN vs approximate ANN (with
WithApproximate()), and update examples/SQL (including hybrid search).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md | Updates the VECTOR_SEARCH section to document the new composable LINQ pattern and behavior. |
| entity-framework/core/providers/sql-server/vector-search.md | Restructures and updates SQL Server vector search documentation/examples to use Take() + WithApproximate() and show updated generated SQL. |
AndriySvyryd
approved these changes
Apr 28, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
The
VectorSearch()API in EF Core has been updated (dotnet/efcore#38144) to replace thetopNparameter with a composable LINQ pattern usingTake()and a newWithApproximate()operator. This PR updates the documentation to reflect the new API surface.Key changes:
WithApproximate()subsection explaining its usage and constraints. Updated all code samples and generated SQL to show the newOrderBy().Take().WithApproximate()pattern (replacing the oldtopNparameter). Updated the hybrid search example and its SQL accordingly.Take()andWithApproximate(), and explain the difference between exact and approximate search modes.