I want to know how MongoDB is calculating the score of the text in full text search.
Like if I will search for samsung note edge
in followings:
Samsung Galaxy Note Edge
Samsung Galaxy Note 4
Samsung Galaxy S6 Edge
Samsung Galaxy Note 4 duos
Samsung Z
Full text Search as follows:
db.mobiles.find({
$text : {$search : "samsung note edge"}
}, {
score : {$meta : "textScore" }
}).sort({
score : {$meta : "textScore" }
})
Is giving me result as follows:
{
name : "Samsung Galaxy Note Edge",
score: 1.875000
},
{
name : "Samsung Galaxy Note 4",
score: 1.250000
},
{
name : "Samsung Galaxy S6 Edge",
score: 1.250000
},
{
name : "Samsung Galaxy Note 4 duos",
score: 1.200000
},
{
name : "Samsung Z",
score: 0.750000
}
The results are different if I will search for Samsung edge