Interface VectorSearchQuery

All Superinterfaces:
Bson
All Known Subinterfaces:
TextVectorSearchQuery

@Sealed @Beta(SERVER) public interface VectorSearchQuery extends Bson
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
  • Method Details

    • textQuery

      static TextVectorSearchQuery textQuery(String text)
      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 TextVectorSearchQuery that can be further configured.