Skip to main content

Create Vector Search indexes

To start using Vector Search, you must configure another search index on your database. The process is similar to what you have done in the last section.

Step-by-step guide to creating your Vector Search index​

  1. 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
  2. Click the Create Search Index button.

    The 'Search' section of the cluster details page with the 'Create Search Index' button highlighted
  3. This time, you will use the JSON Editor to create your index

    The 'Configuration Method' step of creating a new search index
  4. Select your database and collection, change the index name to vectorsearch, and add the following code in the JSON editor:

{
"mappings": {
"dynamic": true,
"fields": {
"plot_embedding": {
"dimensions": 1536,
"similarity": "cosine",
"type": "knnVector"
}
}
}
}

Your configuration should look like this.

The 'Configuration Method' step of creating a new search index
  1. The final step allows you to review the index configuration and refine it if needed. Go ahead and click Create Search Index.