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

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

    XMLWordPrintable

    Details

    • Type: Question
    • Status: Closed
    • Priority: Trivial - P5
    • Resolution: Works as Designed
    • Affects Version/s: 3.4.0
    • Fix Version/s: None
    • Component/s: Indexing, Text Search
    • Labels:
      None

      Description

      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?

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: