Table of Contents

Constructor CreateVectorSearchIndexModel

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

CreateVectorSearchIndexModel(FieldDefinition<TDocument>, string, VectorSimilarity, int, params FieldDefinition<TDocument>[])

Initializes a new instance of the CreateVectorSearchIndexModel<TDocument> class for a vector index where the vector embeddings are created manually. The required options for VectorSimilarity and the number of vector dimensions are passed to the constructor.

public CreateVectorSearchIndexModel(FieldDefinition<TDocument> field, string name, VectorSimilarity similarity, int dimensions, params FieldDefinition<TDocument>[] filterFields)

Parameters

field FieldDefinition<TDocument>

The field containing the vectors to index.

name string

The index name.

similarity VectorSimilarity

The VectorSimilarity to use to search for top K-nearest neighbors.

dimensions int

Number of vector dimensions that vector search enforces at index-time and query-time.

filterFields FieldDefinition<TDocument>[]

Fields that may be used as filters in the vector query.

CreateVectorSearchIndexModel(Expression<Func<TDocument, object>>, string, VectorSimilarity, int, params Expression<Func<TDocument, object>>[])

Initializes a new instance of the CreateVectorSearchIndexModel<TDocument> class for a vector index where the vector embeddings are created manually. The required options for VectorSimilarity and the number of vector dimensions are passed to the constructor.

public CreateVectorSearchIndexModel(Expression<Func<TDocument, object>> field, string name, VectorSimilarity similarity, int dimensions, params Expression<Func<TDocument, object>>[] filterFields)

Parameters

field Expression<Func<TDocument, object>>

An expression pointing to the field containing the vectors to index.

name string

The index name.

similarity VectorSimilarity

The VectorSimilarity to use to search for top K-nearest neighbors.

dimensions int

Number of vector dimensions that vector search enforces at index-time and query-time.

filterFields Expression<Func<TDocument, object>>[]

Expressions pointing to fields that may be used as filters in the vector query.