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

Certain queries can fail on collection containing compound index with "text" component

    • Hide

      Some command line statements that will show the issue.

      > db.stacks.find()
      { "_id" : "S00001", "name" : "stack S00001", "description" : "description right beneath early feel as cars and give
       one little able animals good try food my a in drinks kids education use events design or", "authorId" : "U00001", "published" : true, "popularity" : 0, "galleryId" : "G00001", "popularityHistory" : [ ], "popularityDate" : ISODate("2012-04-18T23:26:14Z"), "comments" : [ ], "blocks" : [ ], "updatedDate" : ISODate("2013-04-18T23:26:15.850Z"), "createdDate" : ISODate("2013-04-18T23:26:15.850Z"), "__v" : 0 }
       
      > db.stacks.getIndexes()
      [
              {
                      "v" : 1,
                      "key" : {
                              "_id" : 1
                      },
                      "ns" : "unit_test.stacks",
                      "name" : "_id_"
              },
              {
                      "v" : 1,
                      "key" : {
                              "_fts" : "text",
                              "_ftsx" : 1,
                              "published" : 1
                      },
                      "ns" : "unit_test.stacks",
                      "name" : "textIndex",
                      "background" : true,
                      "safe" : null,
                      "weights" : {
                              "name" : 1
                      },
                      "default_language" : "english",
                      "language_override" : "language",
                      "textIndexVersion" : 1
              }
      ]
      
      > db.stacks.runCommand('text', {search: 'stack'})
      {
              "queryDebugString" : "stack||||||",
              "language" : "english",
              "results" : [
                      {
                              "score" : 0.75,
                              "obj" : {
                                      "_id" : "S00001",
                                      "name" : "stack S00001",
                                      "description" : "description right beneath early feel as cars and give one little able animals good try food my a in drinks kids education use events design or",
                                      "authorId" : "U00001",
                                      "published" : true,
                                      "popularity" : 0,
                                      "galleryId" : "G00001",
                                      "popularityHistory" : [ ],
                                      "popularityDate" : ISODate("2012-04-18T23:28:32Z"),
                                      "comments" : [ ],
                                      "blocks" : [ ],
                                      "updatedDate" : ISODate("2013-04-18T23:28:34.387Z"),
                                      "createdDate" : ISODate("2013-04-18T23:28:34.386Z"),
                                      "__v" : 0
                              }
                      }
              ],
              "stats" : {
                      "nscanned" : 1,
                      "nscannedObjects" : 0,
                      "n" : 1,
                      "nfound" : 1,
                      "timeMicros" : 118
              },
              "ok" : 1
      }
      
      > db.stacks.find({published: true});
      error: { "$err" : "assertion src\\mongo\\db\\fts\\fts_index.cpp:55" }
      
      Show
      Some command line statements that will show the issue. > db.stacks.find() { "_id" : "S00001" , "name" : "stack S00001" , "description" : "description right beneath early feel as cars and give one little able animals good try food my a in drinks kids education use events design or ", " authorId " : " U00001 ", " published " : true , " popularity " : 0, " galleryId " : " G00001 ", " popularityHistory " : [ ], " popularityDate " : ISODate(" 2012-04-18T23:26:14Z "), " comments " : [ ], " blocks " : [ ], " updatedDate " : ISODate(" 2013-04-18T23:26:15.850Z "), " createdDate " : ISODate(" 2013-04-18T23:26:15.850Z "), " __v" : 0 } > db.stacks.getIndexes() [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "unit_test.stacks" , "name" : "_id_" }, { "v" : 1, "key" : { "_fts" : "text" , "_ftsx" : 1, "published" : 1 }, "ns" : "unit_test.stacks" , "name" : "textIndex" , "background" : true , "safe" : null , "weights" : { "name" : 1 }, "default_language" : "english" , "language_override" : "language" , "textIndexVersion" : 1 } ] > db.stacks.runCommand( 'text' , {search: 'stack' }) { "queryDebugString" : "stack||||||" , "language" : "english" , "results" : [ { "score" : 0.75, "obj" : { "_id" : "S00001" , "name" : "stack S00001" , "description" : "description right beneath early feel as cars and give one little able animals good try food my a in drinks kids education use events design or" , "authorId" : "U00001" , "published" : true , "popularity" : 0, "galleryId" : "G00001" , "popularityHistory" : [ ], "popularityDate" : ISODate( "2012-04-18T23:28:32Z" ), "comments" : [ ], "blocks" : [ ], "updatedDate" : ISODate( "2013-04-18T23:28:34.387Z" ), "createdDate" : ISODate( "2013-04-18T23:28:34.386Z" ), "__v" : 0 } } ], "stats" : { "nscanned" : 1, "nscannedObjects" : 0, "n" : 1, "nfound" : 1, "timeMicros" : 118 }, "ok" : 1 } > db.stacks.find({published: true }); error: { "$err" : "assertion src\\mongo\\db\\fts\\fts_index.cpp:55" }

      1) add a full-text index that includes a boolean or integer field, either before or after the full text index.
      2) perform a regular .find() query that filters on the boolean field
      3) error:

      { "$err" : "assertion src\\mongo\\db\\fts\\fts_index.cpp:55" }

            Assignee:
            rassi J Rassi
            Reporter:
            wshaver Will Shaver
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: