This server side query in Meteor returns "No query solutions"
$or: [
{
$text: {
$search: searchValue,
$caseSensitive: false,
$diacriticSensitive: false
}
},
{
content: {$regex: re}
}
]
This server side query in Meteor returns "No query solutions"
$or: [
{
$text: {
$search: searchValue,
$caseSensitive: false,
$diacriticSensitive: false
}
},
{
content: {$regex: re}
}
]
You must to create text indexes to map each element you wanna search. Example:
db.collection.createIndex({ element1: "text",
element2:'text' })
"To use a $text query in an $or expression, all clauses in the $or array must be indexed."
Restrictions are defined at $text behavior
What worked for me was creating a non-text index on all the fields that you are doing the $regex search on. A simple ascending or descending index should do the trick!
© 2022 - 2024 — McMap. All rights reserved.
OrbiterCMSArticles.rawCollection().find(query)
? – Compose