Create an Atlas Vector Search Index
On this page
New in version 1.42.1.
You can create Atlas Vector Search indexes using MongoDB Compass. These indexes enable you to index vector data and other data types, which facilitates semantic searches on the indexed fields. Atlas Vector Search indexes support indexing vector data by identifying the most similar vectors. The index determines similarity by calculating the distance between the query vector and the vectors stored in the index.
About this Task
To create an Atlas Search index, your deployment must align with one of the following cases:
A deployment hosted on MongoDB Atlas and have an Atlas cluster tier of M10 or higher.
A local deployment that is set up using the Atlas CLI.
Additionally, your deployment must run MongoDB version 7.0 or later.
Steps
Open the index creation dialog
From the Indexes tab, click the Create button and then click Search Index.
Provide the Atlas Vector Search Index configurations
You must initially provide the following default vector search index configurations. You can modify the configurations later.
Field | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
type | string | Human-readable label that identifies the type of index. The value must
be vector to perform a vector search against the indexed fields. If
omitted, it defaults to search , which only supports full-text search. | ||||||||
path | string | The field name to index. | ||||||||
numDimensions | int | The number of vector dimensions, which Atlas Search enforces at index- and
query-time. This value can't be greater than 4096. | ||||||||
similarity | string | The vector similarity function used to search for the top K-nearest neighbors. Select from the following functions:
|
Example
The following example definition uses the sample_mflix.embedded_movies
collection
and indexes the plot_embedding
field to create an Atlas Vector Search index:
{ "fields": [ { "type": "vector", "path": "plot_embedding", "numDimensions": 1536, "similarity": "euclidean" } ] }
Results
To view the status of your created index, go to the Indexes tab and set the toggle at the top-right to Search Indexes.
The Status column indicates the status of the index. When the status is Ready, your index is ready to use.
For more information on search index statuses, see Atlas Search Index Statuses.