[SERVER-12592] error message unclear for OR with text and unindexed clause Created: 03/Feb/14  Updated: 09/Mar/14  Resolved: 13/Feb/14

Status: Closed
Project: Core Server
Component/s: Querying, Text Search
Affects Version/s: 2.5.5
Fix Version/s: 2.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-12173 when $text is in $or, it should be e... Closed
is related to DOCS-2718 OR queries involving TEXT have to be ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

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" } ] }



 Comments   
Comment by Githook User [ 13/Feb/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12592 produce intelligible error message for failed TEXT under OR planning
Branch: master
https://github.com/mongodb/mongo/commit/db7b5a93e9bdfee1826a91b94a9f8b904be89813

Generated at Thu Feb 08 03:28:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.