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

text indexing picks up strings in arrays ignoring remaining dotted path

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.3
    • Affects Version/s: 2.4.0, 2.4.1, 2.4.2, 2.4.3
    • Component/s: Text Search
    • ALL

      > use test2
      switched to db test2
      > db.tweets.save( {_id:1,comments:["this is important",{b:"this is unimportant"},"green",{b:"blue"}]} );
      > db.tweets.ensureIndex({ "comments.b" : "text" });
      > db.tweets.runCommand("text",{ search : "unimportant" });
      {
      	"queryDebugString" : "unimport||||||",
      	"language" : "english",
      	"results" : [
      		{
      			"score" : 1,
      			"obj" : {
      				"_id" : 1,
      				"comments" : [
      					"this is important",
      					{
      						"b" : "this is unimportant"
      					},
      					"green",
      					{
      						"b" : "blue"
      					}
      				]
      			}
      		}
      	],
      	"stats" : {
      		"nscanned" : 1,
      		"nscannedObjects" : 0,
      		"n" : 1,
      		"nfound" : 1,
      		"timeMicros" : 122
      	},
      	"ok" : 1
      }
      > db.tweets.runCommand("text",{ search : "important" });
      {
      	"queryDebugString" : "import||||||",
      	"language" : "english",
      	"results" : [
      		{
      			"score" : 1,
      			"obj" : {
      				"_id" : 1,
      				"comments" : [
      					"this is important",
      					{
      						"b" : "this is unimportant"
      					},
      					"green",
      					{
      						"b" : "blue"
      					}
      				]
      			}
      		}
      	],
      	"stats" : {
      		"nscanned" : 1,
      		"nscannedObjects" : 0,
      		"n" : 1,
      		"nfound" : 1,
      		"timeMicros" : 89
      	},
      	"ok" : 1
      }

            Assignee:
            rassi J Rassi
            Reporter:
            paul.pedersen Paul Pedersen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: