Package com.mongodb.client.model
Class VectorSearchIndexFields
java.lang.Object
com.mongodb.client.model.VectorSearchIndexFields
A factory for defining fields within a vector search index definition.
A convenient way to use this class is to statically import all of its methods, which allows usage like:
SearchIndexDefinition.vectorSearch(
vectorField("plot_embedding")
.numDimensions(1536)
.similarity("euclidean")
.indexingMethod("flat"),
filterField("genre")
);
- Since:
- 5.8
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAn auto-embed field definition for a vector search index.static final classA filter field definition for a vector search index.static final classA vector field definition for a vector search index. -
Method Summary
Modifier and TypeMethodDescriptionautoEmbedField(String path) Creates an auto-embed field definition for a vector search index.filterField(String path) Creates a filter field definition for a vector search index.vectorField(String path) Creates a vector field definition for a vector search index.
-
Method Details
-
vectorField
Creates a vector field definition for a vector search index.- Parameters:
path- the field path in the document- Returns:
- a new
VectorSearchIndexFields.VectorField - Since:
- 5.8
-
filterField
Creates a filter field definition for a vector search index.- Parameters:
path- the field path in the document- Returns:
- a new
VectorSearchIndexFields.FilterField - Since:
- 5.8
-
autoEmbedField
Creates an auto-embed field definition for a vector search index.- Parameters:
path- the field path in the document containing the content to embed- Returns:
- a new
VectorSearchIndexFields.AutoEmbedField - Since:
- 5.8
-