I'm trying to perform a vector search using pymongo, here is my index definition:
{
"fields": [
{
"numDimensions": 1536,
"path": "embeddings",
"similarity": "cosine",
"type": "vector"
},
{
"path": "company",
"type": "filter"
},
{
"path": "age",
"type": "filter"
}
]
}
and here is my python code
db.collection.aggregate([
{
"$vectorSearch": {
"index": "test_index",
"path": "embeddings",
"queryVector": embeddings,
"numCandidates": 100,
"limit": 5
}
}
])
When I run this code I get the error: pymongo.errors.OperationFailure: PlanExecutor error during aggregation :: caused by :: embeddings is not indexed as knnVector
I tried updating the index definition to "type": "knnVector" but I'm still getting the same error, any idea of how to solve this issue?