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

Geospatial index intersection errors when used with a compound index

    • ALL
    • Hide
      db.foo.insert({fname:"MICKEY",lname:"MOUSE",state:"FL", loc:{type:"Point",coordinates:[-81.513743,28.369947]}})
      
      db.foo.ensureIndex({"lname":1,"state":1},{name:"MYINDEX"})
      db.foo.ensureIndex({loc:"2dsphere"})
      
      // This will fail
      db.foo.find({loc:{$near:{$geometry:{type:"Point",coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname:"MOUSE"})
      
      
      db.foo.dropIndex("MYINDEX")
      db.foo.ensureIndex({"lname":1},{name:"MYINDEX"})
      
      // This will work since MYINDEX is not a compound index
      db.foo.find({loc:{$near:{$geometry:{type:"Point",coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname:"MOUSE"})
      
      Show
      db.foo.insert({fname: "MICKEY" ,lname: "MOUSE" ,state: "FL" , loc:{type: "Point" ,coordinates:[-81.513743,28.369947]}}) db.foo.ensureIndex({ "lname" :1, "state" :1},{name: "MYINDEX" }) db.foo.ensureIndex({loc: "2dsphere" }) // This will fail db.foo.find({loc:{$near:{$geometry:{type: "Point" ,coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname: "MOUSE" }) db.foo.dropIndex( "MYINDEX" ) db.foo.ensureIndex({ "lname" :1},{name: "MYINDEX" }) // This will work since MYINDEX is not a compound index db.foo.find({loc:{$near:{$geometry:{type: "Point" ,coordinates : [-81.513743,28.369947] }, $maxDistance :100}},lname: "MOUSE" })

      Geospatial index query fail's when a non-geo field in the query is a part of a compound index. Perhaps a bug in the new 2.6 index intersection feature

      error:

      { "$err" : "assertion src/mongo/db/exec/s2near.cpp:65" }

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            rajeXsh Rajesh Khot
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: