You need to enable JavaScript to run this app.
Document Database for MongoDB

Document Database for MongoDB

Copy page
Download PDF
Vector search
Creating auto-embedding vector index
Copy page
Download PDF
Creating auto-embedding vector index
The auto-embedding vector index automatically generates vectors by calling the Ark Embedding model, eliminating the need for manual vector data maintenance. This topic describes how to create an auto-embedding vector index on the MongoDB console.​
Prerequisite​
  • You have created a MongoDB 8.3 or later instance and enabled the search feature. For specific procedures, refer to Creating instance.​
  • The instance status is Running. For more details about instance status, refer to Instance status.​
  • You have enabled the vector model service on the Ark console and obtained an API Key. For specific steps, refer to Getting Ark API Key.​
tip​
Currently, MongoDB 8.3 is in the invitation-only testing phase. To use the auto-embedding vector search feature, submit a ticket to contact technical staff and apply for access.​
Procedure​
  1. Log on to the MongoDB console.​
  1. In the top menu bar, select the project and region for the instance.​
  1. Select either Replica set instances or Sharding instances in the left navigation bar depending on the instance type.​
  1. On the target instance type list page, click the target instance name.​
  1. On the instance details page, click the AI Capabilities tab.​
  1. Under the Vector index sub-tab, click Createindex.​
  1. On the Create vector index page, configure the following parameters.​
​
Parameter​
​
Required​
Description​
Index configuration​
Search type​
Yes​
This parameter is fixed as vector search,and you do not need to select it.​
​
Embedding method​
​
Yes​
​
Select Auto, meaning MongoDB calls the Ark Embedding model to automatically generate vectors and write them to the index.​
tip​
  • If the current instance has not yet configured an API Key, go to the API Key management tab to fill it out. For specific steps, see Getting Ark API key.​
  • During API Key verification, the instance will enter the Configuration modifying status. After the instance recovers to the Running state, you can continue to create indexes.​
Index name and data source​
Index name​
Yes​
Set the index name. The name must meet the following conditions simultaneously:​
  • Must start with a lowercase English letter.​
  • Must end with a lowercase English letter or a number.​
  • Can only contain English letters, numbers, underscores (_), and hyphens (-).​
  • It cannot start with a number or hyphen (-).​
  • Cannot contain spaces, Chinese characters, special characters, or consecutive special symbols.​
warning​
Within the same instance, the index name must be unique.​
​
Database name​
Yes​
Select the database to which the index belongs from the dropdown list.​
tip​
The database name and table name are both set during database creation. For specific steps, see Database management.​
​
Collection name​
Yes​
Select the collection to which the index belongs from the dropdown list.​
tip​
Both the database name and collection name are set when creating the database. For specific steps, see Database management.​
​
  1. After completing the above configuration, click Next in the bottom-right corner to go to the index configuration page.​
​
Parameter​
​
Required​
Description​
Index field configuration​
​
Field-level vectorization configuration​
Yes​
​
Field configuration​
  • Source text field: Required. Sets the path for the source text field, specifying which field the index should be built on. For more details, refer to path.​
  • Embedding model: Required. Select an embedding model from the dropdown list. Currently, only doubao-embedding-vision-251215 is supported.​
  • Vector Dimension: Required. Sets the number of vector dimensions that MongoDB vector search enforces during indexing and querying. Currently, only 1024 and 2048 are supported. For more details, refer to numDimensions.​
  • Similarity algorithm: Required. Select a similarity algorithm from the dropdown list. The value range is as follows:​
  • Dot Product: Measures similarity based on the angle and magnitude between vectors. For more details, refer to Dot product.​
  • Euclidean distance: Measures the distance between vector endpoints and can be used to measure similarity from different dimensions. For more details, refer to Euclidean.​
  • Cosine similarity: Measures similarity based on the angle between vectors, and can be used to measure similarity that is not affected by magnitude scaling. For more details, refer to Cosine.​
  • Quantization method: Optional. Select a quantization method from the dropdown list. Quantization is a technique that reduces the storage space and memory usage of vector search indexes by lowering the precision of vector data. Currently, only Float is supported. For more details, refer to Vector quantization.​
tip​
  • Within the same index, different text fields can be associated with distinct embedding models, vector dimensions, similarity algorithms, and quantization methods.​
  • It supports adding multiple field configurations simultaneously.​
Scalar filter field​
Field path​
No​
Optional. Click Add filter field to set the path for the scalar filter field of the index.​
tip​
  • For nested fields, use dot notation to specify the path of the embedded field. You only need to enter the field's key; no need to enter the field type. For example, name and info.age are valid values.​
  • You can add multiple filter fields simultaneously, up to 20.​
​
  1. After the index configuration is complete, click Next to confirm creation information such as basic information and auto embedding field configurations.​
  1. After confirming, click OK to complete the index creation.​
tip​
Index creation is an asynchronous operation and takes some time to complete. It is recommended to search only after confirming the index status becomes READY. For more information about the index status, see $listSearchIndexes (Aggregation Stages).​
​
Last updated: 2026.10.13 19:46:33