π 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 did in the last section.
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.
Click the Create Search Index button.
This time, you will use the JSON Editor to create your index
Select your database and the books
collection, change the index name to vectorsearch
, and add the following code in the JSON editor:
- Serverless Endpoint
- OpenAI
- Google Cloud Vertex AI
{
"fields":[
{
"type": "vector",
"path": "embeddings",
"numDimensions": 1408,
"similarity": "cosine"
}
]
}
{
"fields":[
{
"type": "vector",
"path": "embeddings",
"numDimensions": 1536,
"similarity": "cosine"
}
]
}
{
"fields":[
{
"type": "vector",
"path": "embeddings",
"numDimensions": 1408,
"similarity": "cosine"
}
]
}
The final step allows you to review the index configuration and refine it, if needed. Go ahead and click Create Search Index.