I’m using Mongo Atlas and I receive quite a few warnings about a high examined:returned ratio. Upon inspection the queries in question are using $text
indexes and the $search
feature.
See the query below:
{
"find": "users",
"filter": {
"role": "USER",
"$text": {
"$search": "someone@gmail.com"
}
},
"sort": {
"score": {
"$meta": "textScore"
}
},
"projection": {
"score": {
"$meta": "textScore"
}
},
"limit": 20,
...
}
Is there a way to fix this high ratio? I have an index for role
already and obviously it’s using my text
index.
Thanks! Alex