Hybrid Atlas Search

Hi everyone,

I’m currently working on a project using MongoDB Atlas Search. I have a search index set up that performs keyword-based queries effectively using the $search stage.

Now I would like to take the top N documents returned by that $search, and apply a semantic search ($vectorSearch) only over that filtered subset.

However, MongoDB throws an error stating that $vectorSearch must be the first stage in the aggregation pipeline. I’m aware of this limitation, but I’m looking for a way to combine text search and semantic search, where semantic relevance is calculated only within the documents that match the text query.

Is there any officially supported or recommended way to achieve this?

Any insights or best practices would be greatly appreciated.
Thanks in advance!