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

Atlas Search query parser allowing invalid query format.

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.0.0
    • Component/s: None
    • None
    • Query Integration
    • ALL
    • Hide

      Execute this query against the sample_mflix.movies collection. 

       

      {  compound: {    must: [{      text: {        path: "fullplot",        query: "werewolves"      },      text: {        path: "fullplot",        query: "vampires"      }    }]  }} 

      Because the 2 different "text" entries are both attributes in the same doc, only one of them gets processed and the other ignored (in my testing the last one tends to win). But this format of query is never valid, and produces un-expected results from the DB. 

       

      For comparison, the corrected query is this. 

      {  compound: {    must: [{      text: {        path: "fullplot",        query: "werewolves"      }    },    {      text: {        path: "fullplot",        query: "vampires"      }    }]  }} 
      Show
      Execute this query against the sample_mflix.movies collection.    { compound: { must: [{ text: { path: "fullplot" , query: "werewolves" }, text: { path: "fullplot" , query: "vampires" } }] }} Because the 2 different "text" entries are both attributes in the same doc, only one of them gets processed and the other ignored (in my testing the last one tends to win). But this format of query is never valid, and produces un-expected results from the DB.    For comparison, the corrected query is this.  { compound: { must: [{ text: { path: "fullplot" , query: "werewolves" } }, { text: { path: "fullplot" , query: "vampires" } }] }}

      When performing $search queries, if a query contains duplicate keys in one of the embedded objects, the DB will start process the query but give back inaccurate results. Instead it should detect these duplicate key situations and return an error. 

            Assignee:
            ted.tuckman@mongodb.com Ted Tuckman
            Reporter:
            josh.smith@mongodb.com Josh Smith
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: