{ "name": "MongoError", "message": "error processing query: ns=myDB.caseNotesTree: TEXT : query=title, language=english, caseSensitive=0, diacriticSensitive=0, tag=NULL\nSort: {}\nProj: {}\n planner returned error: failed to use text index to satisfy $text query (if text index is compound, are equality predicates given for all prefix fields?)", "waitedMS": 0, "ok": 0, "errmsg": "error processing query: ns=myDB.caseNotesTree: TEXT : query=title, language=english, caseSensitive=0, diacriticSensitive=0, tag=NULL\nSort: {}\nProj: {}\n planner returned error: failed to use text index to satisfy $text query (if text index is compound, are equality predicates given for all prefix fields?)", "code": 2}
where ‘kind’ is the discriminatorKey. I get the error
Hi Antonio,
In your case, since kind
proceeded the text index keys in the compound text index, you would have to run the query including kind
field. For example:
db.collection.find({kind: 42, $text: {$search:"foo"}})
See also Wildcard Text Indexes.
Worth noting that starting in MongoDB v3.2, there is a new text index: text index version 3. See Text Indexes for the new key features.
If you have further questions please also include the following information:
Regards,
Wan.