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

Text indexes should partition index entries by language

    • Query Integration

      A text search for an english word with language set to russian returns english results, searches with the same keyword but language set to spanish return no results

      > db.foo.insert({text:"hello world", language:"english"})
      > db.foo.ensureIndex({text:"text"})
      > db.foo.runCommand("text",{search:"hello",language:"english"})
      {
      	"queryDebugString" : "hello||||||",
      	"language" : "english",
      	"results" : [
      		{
      			"score" : 0.75,
      			"obj" : {
      				"_id" : ObjectId("51435cd6141e7117a6ca8092"),
      				"text" : "hello world",
      				"language" : "english"
      			}
      		}
      	],
      	"stats" : {
      		"nscanned" : 1,
      		"nscannedObjects" : 0,
      		"n" : 1,
      		"nfound" : 1,
      		"timeMicros" : 344
      	},
      	"ok" : 1
      }
      > db.foo.runCommand("text",{search:"hello",language:"spanish"})
      {
      	"queryDebugString" : "hell||||||",
      	"language" : "spanish",
      	"results" : [ ],
      	"stats" : {
      		"nscanned" : 0,
      		"nscannedObjects" : 0,
      		"n" : 0,
      		"nfound" : 0,
      		"timeMicros" : 2383
      	},
      	"ok" : 1
      }
      > db.foo.runCommand("text",{search:"hello",language:"russian"})
      {
      	"queryDebugString" : "hello||||||",
      	"language" : "russian",
      	"results" : [
      		{
      			"score" : 0.75,
      			"obj" : {
      				"_id" : ObjectId("51435cd6141e7117a6ca8092"),
      				"text" : "hello world",
      				"language" : "english"
      			}
      		}
      	],
      	"stats" : {
      		"nscanned" : 1,
      		"nscannedObjects" : 0,
      		"n" : 1,
      		"nfound" : 1,
      		"timeMicros" : 243
      	},
      	"ok" : 1
      }
      >
      

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            mikedransfield Mike Dransfield
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: