-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: 2.5.5
-
Component/s: Querying, Text Search
-
None
-
Fully Compatible
-
ALL
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The query below should return one document – it instead fails to output a query solution.
> db.foo.insert({_id:0, a:"hello"})
SingleWriteResult({
"writeErrors" : [ ],
"writeConcernErrors" : [ ],
"nInserted" : 1,
"nUpserted" : 0,
"nUpdated" : 0,
"nModified" : 0,
"nRemoved" : 0,
"upserted" : [ ]
})
> db.foo.ensureIndex({a:"text"})
> db.foo.find({$or: [{$text: {$search: "hello"}},{a:"hello"}]})
error: {
"$err" : "Unable to execute query: error processing query: ns=test.foo limit=0 skip=0\nTree: $or\n a == \"hello\"\n TEXT : query=hello, language = , tag=NULL\nSort: {}\nProj: {}\n No query solutions",
"code" : 17007
}
Verbose query log:
2014-02-03T17:02:12.599-0500 [conn1] Running query on new system: ns=test.foo limit=0 skip=0
Tree: $or
a == "hello"
TEXT : query=hello, language = , tag=NULL
Sort: {}
Proj: {}
2014-02-03T17:02:12.599-0500 [conn1] =============================
Beginning planning, options = INCLUDE_COLLSCAN
Canonical query:
ns=test.foo limit=0 skip=0
Tree: $or
a == "hello"
TEXT : query=hello, language = , tag=NULL
Sort: {}
Proj: {}
=============================
2014-02-03T17:02:12.599-0500 [conn1] idx 0 is kp: { _id: 1 } io: { v: 1, key: { _id: 1 }, name: "_id_", ns: "test.foo" }
2014-02-03T17:02:12.599-0500 [conn1] idx 1 is kp: { _fts: "text", _ftsx: 1 } io: { v: 1, key: { _fts: "text", _ftsx: 1 }, name: "a_text", ns: "test.foo", weights: { a: 1 }, default_language: "english", language_override: "language", textIndexVersion: 2 }
2014-02-03T17:02:12.599-0500 [conn1] predicate over field _fts
2014-02-03T17:02:12.599-0500 [conn1] predicate over field a
2014-02-03T17:02:12.599-0500 [conn1] relevant idx 0 is kp: { _fts: "text", _ftsx: 1 } io: { v: 1, key: { _fts: "text", _ftsx: 1 }, name: "a_text", ns: "test.foo", weights: { a: 1 }, default_language: "english", language_override: "language", textIndexVersion: 2 }
2014-02-03T17:02:12.599-0500 [conn1] rated tree
2014-02-03T17:02:12.599-0500 [conn1] $or
a == "hello" First: notFirst: full path: a
TEXT : query=hello, language = , tag=First: 0 notFirst: full path: _fts
2014-02-03T17:02:12.599-0500 [conn1] enumerator received root:
$or
a == "hello" First: notFirst: full path: a
TEXT : query=hello, language = , tag=First: 0 notFirst: full path: _fts
2014-02-03T17:02:12.599-0500 [conn1] Planner: outputted 0 indexed solutions.
2014-02-03T17:02:12.599-0500 [conn1] assertion 17007 Unable to execute query: error processing query: ns=test.foo limit=0 skip=0
Tree: $or
a == "hello"
TEXT : query=hello, language = , tag=NULL
Sort: {}
Proj: {}
No query solutions ns:test.foo query:{ $or: [ { $text: { $search: "hello" } }, { a: "hello" } ] }
- is related to
-
SERVER-12173 when $text is in $or, it should be evalutate first
-
- Closed
-