Skip to main content

๐Ÿ‘ Create Vector Search indexes

To start using Vector Search, you must configure another search index on your database.

Step-by-step guide to creating your Vector Search indexโ€‹

Open the Database Deployments page in MongoDB Atlas and select Create Index in the lower right corner.

The 'Database Deployments' page with the 'Create Index' link highlighted

Click the Create Search Index button.

The 'Create Index' page with the 'Create Search Index' button highlighted

This time, you will use the JSON Editor to create your index

The 'Create Index' page with the 'JSON Editor' tab highlighted

Select your database and collection, leave the index name set to vector_index, and add the following code in the JSON editor:

{
"fields": [{
"type": "vector",
"path": "embedding",
"numDimensions": 1536,
"similarity": "cosine"
}]
}

The final step allows you to review the index configuration and refine it if needed. Go ahead and click Create Search Index.