Table of Contents

Class CreateVectorSearchIndexModel<TDocument>

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Defines a vector index model for pre-embedded vector indexes using strongly-typed C# APIs.

public sealed class CreateVectorSearchIndexModel<TDocument> : CreateVectorSearchIndexModelBase<TDocument>

Type Parameters

TDocument
Inheritance
CreateVectorSearchIndexModel<TDocument>
Inherited Members

Constructors

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.

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.

Properties

Dimensions

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

HnswMaxEdges

Maximum number of edges (or connections) that a node can have in the Hierarchical Navigable Small Worlds graph.

HnswNumEdgeCandidates

Analogous to numCandidates at query-time, this parameter controls the maximum number of nodes to evaluate to find the closest neighbors to connect to a new node.

Quantization

Type of automatic vector quantization for your vectors.

Similarity

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