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

Inconsistent / missing text search results when documents contain "language" key

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

      db.foo.drop()
      db.foo.ensureIndex({description: "text"})
      db.foo.insert({_id:1,  description:"radionuclides", language:"English"})
      db.foo.insert({_id:2,  description:"chromosome", language:"English"})
      db.foo.insert({_id:3,  description:"study", language:"English"})
      db.foo.insert({_id:4,  description:"chemical", language:"English"})
      db.foo.insert({_id:5,  description:"radiopharmaceuticals", language:"English"})
      db.foo.insert({_id:6,  description:"transduction", language:"English"})
      db.foo.insert({_id:7,  description:"constraints", language:"English"})
      db.foo.insert({_id:8,  description:"novel", language:"English"})
      db.foo.insert({_id:9,  description:"responsible", language:"English"})
      db.foo.insert({_id:10, description:"cancer", language:"English"})
      db.foo.insert({_id:11, description:"description", language:"English"})
      db.foo.insert({_id:12, description:"sensor", language:"English"})
      
      // These terms are NOT found
      db.foo.runCommand( "text", { search: "radionuclides" } ).stats.n
      db.foo.runCommand( "text", { search: "chromosome" } ).stats.n
      db.foo.runCommand( "text", { search: "study" } ).stats.n
      db.foo.runCommand( "text", { search: "chemical" } ).stats.n
      db.foo.runCommand( "text", { search: "radiopharmaceuticals" } ).stats.n
      db.foo.runCommand( "text", { search: "transduction" } ).stats.n
      db.foo.runCommand( "text", { search: "consequences" } ).stats.n
      db.foo.runCommand( "text", { search: "responsible" } ).stats.n
      db.foo.runCommand( "text", { search: "constraints" } ).stats.n
      db.foo.runCommand( "text", { search: "description" } ).stats.n
      
      // These terms are found
      db.foo.runCommand( "text", { search: "novel" } ).stats.n
      db.foo.runCommand( "text", { search: "cancer" } ).stats.n
      db.foo.runCommand( "text", { search: "sensor" } ).stats.n
      
      db.foo.update({}, {$unset:{language:1}}, {multi:true})
      
      // Now all terms are found
      db.foo.runCommand( "text", { search: "radionuclides" } ).stats.n
      db.foo.runCommand( "text", { search: "chromosome" } ).stats.n
      db.foo.runCommand( "text", { search: "study" } ).stats.n
      db.foo.runCommand( "text", { search: "chemical" } ).stats.n
      db.foo.runCommand( "text", { search: "radiopharmaceuticals" } ).stats.n
      db.foo.runCommand( "text", { search: "transduction" } ).stats.n
      db.foo.runCommand( "text", { search: "consequences" } ).stats.n
      db.foo.runCommand( "text", { search: "responsible" } ).stats.n
      db.foo.runCommand( "text", { search: "constraints" } ).stats.n
      db.foo.runCommand( "text", { search: "description" } ).stats.n
      db.foo.runCommand( "text", { search: "novel" } ).stats.n
      db.foo.runCommand( "text", { search: "cancer" } ).stats.n
      db.foo.runCommand( "text", { search: "sensor" } ).stats.n
      

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            mark.helmstetter@mongodb.com Mark Helmstetter
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: