Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13021

$text queries fail if an ascending index on "_fts" exists

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Text Search
    • Labels:
    • ALL

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

            Assignee:
            rassi J Rassi
            Reporter:
            rassi J Rassi
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: