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

Should a text query for 'leaderboard' match 'leader-board'?

    • Type: Icon: Question Question
    • Resolution: Works as Designed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: 3.4.0
    • None

      I was surprised by the last line:

      > db.y.find()
      > db.y.createIndex({name:'text'})
      {
              "createdCollectionAutomatically" : true,
              "numIndexesBefore" : 1,
              "numIndexesAfter" : 2,
              "ok" : 1
      }
      > db.y.insert({name:'leader-board'})
      WriteResult({ "nInserted" : 1 })
      > db.y.find({$text:{$search:'leader'}})
      { "_id" : ObjectId("586b69d30c34db31e74c6413"), "name" : "leader-board" }
      > db.y.find({$text:{$search:'leader board'}})
      { "_id" : ObjectId("586b69d30c34db31e74c6413"), "name" : "leader-board" }
      > db.y.find({$text:{$search:'leader-board'}})
      { "_id" : ObjectId("586b69d30c34db31e74c6413"), "name" : "leader-board" }
      > db.y.find({$text:{$search:'leaderboard'}})
      

      Shouldn't it still match it? I understand in general 'foo-bar' and 'foobar' are not synonyms, but are there ways to associate those terms in some conditions, other than putting both terms?

            Assignee:
            Unassigned Unassigned
            Reporter:
            caub Cyril Auburtin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: