Mongo Atlas Vector Serch

I am trying to execute $vectorSearch pipeline but I need to filter my document before executing the $vectorSearch. I understand that I can’t execute $match before $vectorSearch, that $vectorSearch needs to be done first. There is an option to include filter within the $vectorSearch but when I do this I keep getting errors such as “errmsg” : “PlanExecutor error during aggregation :: caused by :: Path ‘name’ needs to be indexed as token”. I am trying to filter on name and name is already a text index. Not sure why I get this error.

Filters need to be defined explicitly in the vector search index configuration. This is not the same as a regular B-tree index on the database. See https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#atlas-vector-search-index-fields for more details.

Thanks for the help, it is working now.