Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
Query Integration
-
Fully Compatible
-
ALL
-
QI 2023-04-03, QI 2023-04-17, QI 2023-05-15, QI 2023-05-29, QI 2023-06-12, QI 2023-06-26
Description
It appears that using $or to query both _id and a text index do not work together.
See this example:
db.createCollection('c', {clusteredIndex: {key: {_id: 1}, unique: true}})
|
db.c.createIndex({b: "text"})
|
db.c.insert({b: "foo"}
|
db.c.find({$or: [{$text: {$search: "foo"}}, {_id: 1}]})
|
This fails with the following error:
error processing query: ns=test.cTree: $or
|
_id $eq 1
|
TEXT : query=foo, language=english, caseSensitive=0, diacriticSensitive=0, tag=NULL
|
Sort: {}
|
Proj: {}
|
planner returned error :: caused by :: Failed to produce a solution for TEXT under OR - other non-TEXT clauses under OR have to be indexed as well.
|
Attachments
Issue Links
- depends on
-
SERVER-77280 $or queries only produce collscan for clustered collections
-
- Closed
-
-
SERVER-77854 Avoid re-parsing query in CanonicalQuery::canonicalize
-
- Closed
-
-
SERVER-13803 Query planner should be able to plan $text queries that require collection scan
-
- Backlog
-
- is related to
-
SERVER-76176 $text OR condition on phrases not working
-
- Closed
-
- related to
-
SERVER-78045 Nested $or queries with $text nodes should use the $or with clustered collection scan
-
- Backlog
-
-
SERVER-78044 Cache rooted $or queries that use clustered collection scans in SBE
-
- Backlog
-