-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying, Text Search
-
Query Integration
On a schema like the following:
{ _id : ObjectID, productId: String, description: String}
With an index like:
{ fields: { 'productId': 1, 'description': 'text' } }
Doing this query succeeds as expected:
db.products.find({productId: 'P1234', $text: {$search : 'box'} } );
But this query fails:
db.products.find({productId: {$in: ['S00001', 'S00004'] }, $text: {$search : 'box'} } ); "$err" : "Unable to execute query: error processing query: ns=unit_test.products limit=0 skip=0\nTree: $and\n productId $in [ \"S00001\" \"S00004\" ]\n TEXT : query=multiple, language=, 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" : 17007