[SERVER-13017] Error message incorrect for $text query on compound text index w/o index prefix match Created: 03/Mar/14  Updated: 11/Jul/16  Resolved: 10/Mar/14

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

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

Issue Links:
Related
Operating System: ALL
Participants:

 Description   

When a $text query fails because of a missing predicate on the text index prefix, the error message should be "missing equality predicate on text index prefix field", not "need exactly one text index".

> db.foo.ensureIndex({a:1,b:"text"})
WriteResult({ "nInserted" : 1 })
> db.foo.insert({a:1,b:"hello"})
WriteResult({ "nInserted" : 1 })
> db.foo.find({a:1,$text:{$search:"hello"}})
{ "_id" : ObjectId("53151373b685b3ee5e58e538"), "a" : 1, "b" : "hello" }
> db.foo.find({$text:{$search:"hello"}})
error: {
	"$err" : "Unable to execute query: error processing query: ns=test.foo limit=0 skip=0\nTree: TEXT : query=hello, language = , tag=First: notFirst: full path: _fts\nSort: {}\nProj: {}\n planner returned error: need exactly one text index for $text query",
	"code" : 17007
}
>



 Comments   
Comment by Githook User [ 10/Mar/14 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-13017 Fix query planner reporting of text index-related errors
Branch: master
https://github.com/mongodb/mongo/commit/2a161f7e565bc8706bb311f4d68a1783f3d7141e

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