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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.2.6
    • Text Search
    • 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

    Description

      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" ).

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: