MongoQueryableVectorSearchTSource, TField Method (IMongoQueryableTSource, ExpressionFuncTSource, TField, QueryVector, Int32, VectorSearchOptionsTSource) |
Appends a $vectorSearch stage to the LINQ pipeline.
Namespace:
MongoDB.Driver.Linq
Assembly:
MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.22.0+75246110ed1247226fcc7f8eb2c54ffab745693e
Syntax public static IMongoQueryable<TSource> VectorSearch<TSource, TField>(
this IMongoQueryable<TSource> source,
Expression<Func<TSource, TField>> field,
QueryVector queryVector,
int limit,
VectorSearchOptions<TSource> options = null
)
<ExtensionAttribute>
Public Shared Function VectorSearch(Of TSource, TField) (
source As IMongoQueryable(Of TSource),
field As Expression(Of Func(Of TSource, TField)),
queryVector As QueryVector,
limit As Integer,
Optional options As VectorSearchOptions(Of TSource) = Nothing
) As IMongoQueryable(Of TSource)
[<ExtensionAttribute>]
static member VectorSearch :
source : IMongoQueryable<'TSource> *
field : Expression<Func<'TSource, 'TField>> *
queryVector : QueryVector *
limit : int *
?options : VectorSearchOptions<'TSource>
(* Defaults:
let _options = defaultArg options null
*)
-> IMongoQueryable<'TSource>
Parameters
- source
- Type: MongoDB.Driver.LinqIMongoQueryableTSource
A sequence of values. - field
- Type: System.Linq.ExpressionsExpressionFuncTSource, TField
The field. - queryVector
- Type: MongoDB.DriverQueryVector
The query vector. - limit
- Type: SystemInt32
The limit. - options (Optional)
- Type: MongoDB.DriverVectorSearchOptionsTSource
The options.
Type Parameters
- TSource
- The type of the elements of source.
- TField
- The type of the field.
Return Value
Type:
IMongoQueryableTSource
The queryable with a new stage appended.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IMongoQueryableTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also