語言

SqlServerQueryableExtensions.WithApproximate<T> Method

Definition

Enables approximate nearest neighbor (ANN) search for a vector search query. This causes WITH APPROXIMATE to be added to the SQL TOP clause, instructing SQL Server to use the vector index for better performance.

[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)

Type Parameters

T

Parameters

source
IQueryable<T>

Returns

Attributes

Remarks

This method must be called after Take(...) to specify the number of results. Without WithApproximate, vector search performs an exact k-nearest neighbor (kNN) search without using the vector index.

Applies to