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

Text searches with negated terms in phrases don't match correctly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.2
    • Affects Version/s: 2.5.1
    • Component/s: Text Search
    • Labels:
      None
    • ALL

      db.test.drop()
      db.test.insert({words: "tyler dogs"})
      db.test.ensureIndex({"words": "text"})
      
      // expect no results, phrase match works
      > db.test.runCommand('text', {search: "\"tyler cats\""})
      {
      	"queryDebugString" : "cat|tyler||||tyler cats||",
      	"results" : [ ]
      }
      
      // expect no results, phrase match ignores cats!
      > db.test.runCommand('text', {search: "\"tyler -cats\""})
      {
      	"queryDebugString" : "tyler||||||tyler -cats",
      	"results" : [
      		{
      			"score" : 0.75,
      			"obj" : {
      				"_id" : ObjectId("51f2c3adf9477b8250ef438a"),
      				"words" : "tyler dogs"
      			}
      		}
      	]
      }
      

      Would highly recommend backport to 2.4.x. when this gets resolved.

            Assignee:
            rassi J Rassi
            Reporter:
            tyler@10gen.com Tyler Brock
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: