Error "text.path" is required which vector search using PyMongo while using aggregate function using pipeline

I am using python from local machine
I am getting error “text.path” is required, full error: {‘ok’: 0.0, ‘errmsg’: ‘“text.path” is required’, ‘code’: 8,…
my call is
pipeline = [
{
“$search”: {
“text”: {
“query”: “”, # Empty for vector search
},
“knn”: {
“field”: “text_embedding”, # Replace with your field name
“query”: query_vector, # Your query vector
“k”: 5, # Number of neighbors to return
}
}
}
]

if i provide empty message of path in text , then i get text.query cannot be empty.

I am trying to do vector search not text query

i am using M0(free version) of atlas

Hi @hitish_singla To perform vector search you should use the $vectorSearch syntax as described here - https://www.mongodb.com/docs/atlas/atlas-vector-search/tutorials/vector-search-tutorial/

The syntax of $search and knnbeta (https://www.mongodb.com/docs/atlas/atlas-search/knn-beta/) for vector search are deprecated now