Hi @Ethan_kleinlugtenbelt! Thank you for the question, I can answer from the POV of the MongoDB product team.
We are looking at adding support for different types of lexical filters like regex and queryString to the $vectorSearch prefilter. In the meantime, you should be able to use a regex prefilter using the queryString operator as a filter within the knnBeta operator.
[
"$search": {
"index": "vector_index_knnvector",
"knnBeta": {
"filter": {
"compound": {
"must": [
{
"queryString": {
"query": "CAMBRIDGE AND test~2 NOT ALAN",
"defaultPath": "descriptions"
}
},
]
},
"vector": [...],
"path": "seovoc:embeddings",
"k": 2000
}
},
{"$limit": 200}
]
Note that you will have to build a new index using the knnVector field type if you want to take this approach.
I will call out that while both of this operator and field type are deprecated, we would not EOL them before support for this and a few other types of filter in $vectorSearch are supported. Once that day comes you should be able to switch back to using $vectorSearch.
Hopefully this helps, and happy to answer any follow-ups you might have.