Package com.mongodb.client.model
Interface SearchIndexDefinition
- All Superinterfaces:
Bson
- All Known Implementing Classes:
VectorSearchIndexDefinition
A definition for an Atlas Search index.
This interface provides factory methods for creating search index definitions
that can be passed to SearchIndexModel.
- Since:
- 5.8
- See Also:
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic VectorSearchIndexDefinitionvectorSearch(List<? extends Bson> fields) Creates a vector search index definition with the specified fields.static VectorSearchIndexDefinitionvectorSearch(Bson... fields) Creates a vector search index definition with the specified fields.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
vectorSearch
Creates a vector search index definition with the specified fields.The resulting definition produces a document of the form
{"fields": [...]}, suitable for use withSearchIndexType.vectorSearch().- Parameters:
fields- the fields for the vector search index. Each field should be created usingVectorSearchIndexFieldsfactory methods, or may be a rawBsondocument.- Returns:
- a new
VectorSearchIndexDefinition - Since:
- 5.8
- See Also:
-
vectorSearch
Creates a vector search index definition with the specified fields.The resulting definition produces a document of the form
{"fields": [...]}, suitable for use withSearchIndexType.vectorSearch().- Parameters:
fields- the fields for the vector search index. Each field should be created usingVectorSearchIndexFieldsfactory methods, or may be a rawBsondocument.- Returns:
- a new
VectorSearchIndexDefinition - Since:
- 5.8
- See Also:
-