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

Text search ignores some words

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 3.2.7
    • Fix Version/s: None
    • Component/s: Text Search
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      > db.s.insert({"name": "is"})
      WriteResult({ "nInserted" : 1 })
      > db.s.insert({"name": "dog"})
      WriteResult({ "nInserted" : 1 })
      > db.s.createIndex({"name": "text"})
      {
              "createdCollectionAutomatically" : false,
              "numIndexesBefore" : 1,
              "numIndexesAfter" : 2,
              "ok" : 1
      }
      > db.s.find({$text: {$search: "is"}}) *why there are no results?*
      > db.s.find({$text: {$search: "dog"}})
      { "_id" : ObjectId("578287a4a2bdbd1636963ee3"), "name" : "dog" }
      > db.s.insert({"name": "this"})
      WriteResult({ "nInserted" : 1 })
      > db.s.insert({"name": "cat"})
      WriteResult({ "nInserted" : 1 })
      > db.s.find({$text: {$search: "cat"}})
      { "_id" : ObjectId("578287dba2bdbd1636963ee5"), "name" : "cat" }
      > db.s.find({$text: {$search: "this"}})
      

      Show
      > db.s.insert({"name": "is"}) WriteResult({ "nInserted" : 1 }) > db.s.insert({"name": "dog"}) WriteResult({ "nInserted" : 1 }) > db.s.createIndex({"name": "text"}) { "createdCollectionAutomatically" : false, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 } > db.s.find({$text: {$search: "is"}}) *why there are no results?* > db.s.find({$text: {$search: "dog"}}) { "_id" : ObjectId("578287a4a2bdbd1636963ee3"), "name" : "dog" } > db.s.insert({"name": "this"}) WriteResult({ "nInserted" : 1 }) > db.s.insert({"name": "cat"}) WriteResult({ "nInserted" : 1 }) > db.s.find({$text: {$search: "cat"}}) { "_id" : ObjectId("578287dba2bdbd1636963ee5"), "name" : "cat" } > db.s.find({$text: {$search: "this"}})

      Description

      Words like 'this', 'is' are ignored in text search. See Steps to Reproduce for more details

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: