Hello, I have the following query while using the search index:
await Collection.aggregate([
{
"$search": {
"index": "search",
compound: {
should: [
{
autocomplete: {
query: `${req.query.query}`,
path: 'name',
"fuzzy": {
"maxEdits": 2,
"prefixLength": 3
}
},
},
{
autocomplete: {
query: `${req.query.query}`,
path: 'contract',
"fuzzy": {
"maxEdits": 2,
"prefixLength": 3
}
},
},
],
},
},
},
{
$limit: 15
}
])
The problem is that the results are not very accurate, for example:
What I wrote is almost exactly the collection name of “BoredGoats” that is showing me as the second result.
What can I do to solve this problem? To have more accurate results.