Package com.mongodb.client.model
Class VectorSearchIndexDefinition
java.lang.Object
com.mongodb.client.model.VectorSearchIndexDefinition
- All Implemented Interfaces:
SearchIndexDefinition,Bson
A vector search index definition, producing a document of the form
{"fields": [...]}.
Instances are created via SearchIndexDefinition.vectorSearch(Bson...).
- Since:
- 5.8
- See Also:
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY -
Method Summary
Modifier and TypeMethodDescriptionstoredSource(Bson storedSource) Creates a newVectorSearchIndexDefinitionwith the specified stored source configuration.<TDocument>
BsonDocumenttoBsonDocument(Class<TDocument> documentClass, CodecRegistry codecRegistry) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bson.conversions.Bson
toBsonDocument
-
Method Details
-
storedSource
Creates a newVectorSearchIndexDefinitionwith the specified stored source configuration.The stored source configuration controls which fields are stored in the index and can be returned without reading the full document from the collection.
- Parameters:
storedSource- a document specifying the stored source configuration, e.g.,{"include": ["field1", "field2"]}or{"exclude": ["field3"]}- Returns:
- a new
VectorSearchIndexDefinitionwith the stored source configuration - Since:
- 5.8
-
toBsonDocument
public <TDocument> BsonDocument toBsonDocument(Class<TDocument> documentClass, CodecRegistry codecRegistry) - Specified by:
toBsonDocumentin interfaceBson
-
toString
-