Method VectorSearch
VectorSearch<TSource, TField>(IQueryable<TSource>, FieldDefinition<TSource>, QueryVector, int, VectorSearchOptions<TSource>)
Appends a $vectorSearch stage to the LINQ pipeline.
public static IQueryable<TSource> VectorSearch<TSource, TField>(this IQueryable<TSource> source, FieldDefinition<TSource> field, QueryVector queryVector, int limit, VectorSearchOptions<TSource> options = null)
Parameters
source
IQueryable<TSource>A sequence of values.
field
FieldDefinition<TSource>The field.
queryVector
QueryVectorThe query vector.
limit
intThe limit.
options
VectorSearchOptions<TSource>The options.
Returns
- IQueryable<TSource>
The queryable with a new stage appended.
Type Parameters
TSource
The type of the elements of
source
.TField
The type of the field.
VectorSearch<TSource, TField>(IQueryable<TSource>, Expression<Func<TSource, TField>>, QueryVector, int, VectorSearchOptions<TSource>)
Appends a $vectorSearch stage to the LINQ pipeline.
public static IQueryable<TSource> VectorSearch<TSource, TField>(this IQueryable<TSource> source, Expression<Func<TSource, TField>> field, QueryVector queryVector, int limit, VectorSearchOptions<TSource> options = null)
Parameters
source
IQueryable<TSource>A sequence of values.
field
Expression<Func<TSource, TField>>The field.
queryVector
QueryVectorThe query vector.
limit
intThe limit.
options
VectorSearchOptions<TSource>The options.
Returns
- IQueryable<TSource>
The queryable with a new stage appended.
Type Parameters
TSource
The type of the elements of
source
.TField
The type of the field.