Atlas vector search similarity threshold

I had to make 2 changes to make it work.

searchScore => vectorSearchScore
gte => $gte

{
    "$vectorSearch": {
        "index": "vector_index",
        "path": "vector",
        "queryVector": [0.456, 0.311, ...],
        "numCandidates": 100,
        "limit": 10
    }
},
{
    "$addFields": {"score": {"$meta": "vectorSearchScore"}}
},
{
    "$match": {"score": {"$gte": 0.7}}
},
{
    "$project": {"vector": 0}
},
1 Like