-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.0
-
Component/s: Querying, Text Search
-
Query Integration
On a schema like the following:
{ _id : ObjectID, description: String}
With an index like:
{ fields: { 'description': 'text' } }
Doing this with $and query succeeds as expected:
db.products.find({$and:[{$text: {$search : 'box'} }, {search:'Box'}] );
But this query fails:
db.products.find({$or:[{$text: {$search : 'Bob'} }, {search:'Bob'}] );
With this error
$err" : "Runner error: BadValue error processing query: ns=unit_test.products limit=0 skip=0 Tree: $or description== \"Bob\" TEXT : query=Bob, language=, tag=NULL Sort: {} Proj: {} planner returned error: Failed to produce a solution for TEXT under OR - other non-TEXT clauses under OR have to be indexed as well.", "code" : 17144
(I realize this seems asinine, but my actual code is quite a bit more complicated with a full-text index on several different text fields.)
- is depended on by
-
SERVER-61259 $or queries with text indexes fail on clustered collections
- Closed
- is duplicated by
-
SERVER-24913 Remove index restriction on $or clauses for $text searches
- Closed
- related to
-
SERVER-17648 Implement matcher for text predicates
- Backlog