Package com.mongodb.client.model.search
Interface VectorSearchQuery
- All Superinterfaces:
org.bson.conversions.Bson
- All Known Subinterfaces:
TextVectorSearchQuery
A query specification for MongoDB Atlas vector search with automated embedding.
This interface provides factory methods for creating type-safe query objects that can be used
with the $vectorSearch aggregation pipeline stage for auto-embedding functionality.
- Since:
- 5.7.0
- MongoDB Atlas documentation
- $vectorSearch
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic TextVectorSearchQueryCreates a text-based vector search query that will be automatically embedded by the server.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
textQuery
Creates a text-based vector search query that will be automatically embedded by the server.The server will generate embeddings for the provided text using the model specified in the vector search index definition, or an explicitly specified model via
TextVectorSearchQuery.model(String).- Parameters:
text- The text to be embedded and searched.- Returns:
- A
TextVectorSearchQuerythat can be further configured.
-