Update vector search docs for VectorSearch() API changes (dotnet/efcore#38075)#5325
Draft
Update vector search docs for VectorSearch() API changes (dotnet/efcore#38075)#5325
Conversation
… (removal of topN parameter) The topN parameter was removed from VectorSearch() in dotnet/efcore#38075. Users now compose with .OrderBy(r => r.Distance).Take(n) instead. SQL Server generates TOP(...) WITH APPROXIMATE rather than TOP_N inside VECTOR_SEARCH(). Agent-Logs-Url: https://github.com/dotnet/EntityFramework.Docs/sessions/a44e53cf-0113-4f96-b07b-4e403b6e0e9b Co-authored-by: roji <1862641+roji@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
topNparameter was removed fromVectorSearch()in dotnet/efcore#38075. Users now compose with standard LINQ operators instead, and SQL Server generatesTOP(...) WITH APPROXIMATErather thanTOP_NinsideVECTOR_SEARCH().Changes
vector-search.md: Replaced allVectorSearch(..., topN: n)calls with.OrderBy(r => r.Distance).Take(n)pattern, updated generated SQL examples, updated hybrid search example (both C# and SQL)whatsnew.md(EF Core 11): Same API update for the what's new code snippet and descriptionNew pattern
Generated SQL now uses
SELECT TOP(@p) WITH APPROXIMATEinstead ofTOP_N = @pinside theVECTOR_SEARCH()TVF.