語言

SqlServerQueryableExtensions.WithApproximate<T> 方法

定義

啟用向量搜尋查詢的近似最近鄰(ANN)搜尋。 這會導致 WITH APPROXIMATE 加入 SQL TOP 子句,指示 SQL Server 使用向量索引以提升效能。

[System.Diagnostics.CodeAnalysis.Experimental("EF9105")]
public static System.Linq.IQueryable<T> WithApproximate<T>(this System.Linq.IQueryable<T> source);
[<System.Diagnostics.CodeAnalysis.Experimental("EF9105")>]
static member WithApproximate : System.Linq.IQueryable<'T> -> System.Linq.IQueryable<'T>
<Extension()>
Public Function WithApproximate(Of T) (source As IQueryable(Of T)) As IQueryable(Of T)

類型參數

T

參數

source
IQueryable<T>

傳回

屬性

備註

此方法必須在之後 Take(...) 被呼叫以指定結果數量。 若無 WithApproximate,向量搜尋即可執行精確的 k 最近鄰(kNN)搜尋,且不使用向量索引。

適用於