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

When using phrases in text search other individual terms are not respected

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.6
    • Component/s: Text Search
    • Labels:
      None
    • ALL
    • Hide
      db.getCollection('tests').drop()
      db.getCollection('tests').createIndex({ someText: "text" })
      db.getCollection('tests').insert({ someText: "ssl certificate authority key" })
      db.getCollection('tests').find({ $text: { $search: "\"ssl certificate\" authority key" } }) // found one - as expected
      db.getCollection('tests').find({ $text: { $search: "\"ssl certificate\" mongodb regex" } }) // found one - same as above - not as expected
      
      Show
      db.getCollection( 'tests' ).drop() db.getCollection( 'tests' ).createIndex({ someText: "text" }) db.getCollection( 'tests' ).insert({ someText: "ssl certificate authority key" }) db.getCollection( 'tests' ).find({ $text: { $search: "\" ssl certificate\ " authority key" } }) // found one - as expected db.getCollection( 'tests' ).find({ $text: { $search: "\" ssl certificate\ " mongodb regex" } }) // found one - same as above - not as expected

      When specifying a text search such as "\"ssl certificate\" authority key"
      the individual terms "authority" and "key" is not respected as per the docs.

      The $text operator searches for the phrase "ssl certificate" and ("authority" or "key" or "ssl" or "certificate" ).

            Assignee:
            Unassigned Unassigned
            Reporter:
            Faleij Faleij
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: