Skip to content

Document WithApproximate LINQ operator for SQL Server vector search#5346

Merged
roji merged 2 commits intodotnet:preview.5from
roji:roji/vector-search-docs-update
Apr 28, 2026
Merged

Document WithApproximate LINQ operator for SQL Server vector search#5346
roji merged 2 commits intodotnet:preview.5from
roji:roji/vector-search-docs-update

Conversation

@roji
Copy link
Copy Markdown
Member

@roji roji commented Apr 25, 2026

The VectorSearch() API in EF Core has been updated (dotnet/efcore#38144) to replace the topN parameter with a composable LINQ pattern using Take() and a new WithApproximate() operator. This PR updates the documentation to reflect the new API surface.

Key changes:

  • SQL Server vector search page: Restructured the "Approximate search with VECTOR_SEARCH()" section into "Searching with VECTOR_SEARCH()" to reflect that the TVF now supports both exact kNN and approximate ANN search. Added a dedicated WithApproximate() subsection explaining its usage and constraints. Updated all code samples and generated SQL to show the new OrderBy().Take().WithApproximate() pattern (replacing the old topN parameter). Updated the hybrid search example and its SQL accordingly.
  • What's new page: Updated the VECTOR_SEARCH() section to show the new API with Take() and WithApproximate(), and explain the difference between exact and approximate search modes.

Document dotnet/efcore#38144

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread entity-framework/core/what-is-new/ef-core-11.0/whatsnew.md
Comment thread entity-framework/core/providers/sql-server/vector-search.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@roji roji merged commit 0e81311 into dotnet:preview.5 Apr 28, 2026
4 checks passed
@roji roji deleted the roji/vector-search-docs-update branch April 28, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants