|
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?
|