-
Type: Task
-
Resolution: Won't Fix
-
Priority: Blocker - P1
-
Affects Version/s: mongodb-2.6
-
Component/s: manual
-
Labels:None
I created an text index this way:
db.myCollection.ensureIndex(
{firstName:"text", lastName:"text", email:"text", birthDate:"text"},{name:"text_index", weights:{lastName:2, email:2}})
so that I can set a threshold (maybe 3) as a minimum score to consider that 2 records are "almost the same".
Now I create example/dummy documents, for instance:
{firstName:"ROBERT", lastName:"LANE", email: "imnotxavier@mail.com"}and perform this query db.myCollection.find({$text:{$search: "ROBERT LANE"}},{score:{$meta:"textScore"}})
I get this:
{ "_id" : ObjectId("53b6c9f12a48e559dec0f6ab"), "firstName" : "ROBERT", "lastName" : "LANE", "email" : "imnotxavier@mail.com", "score" : 3.3000000000000003 }Why does MongoDB do this instead of returning a document with score==3?
I need to know a little more about the details of the scoring system in order to correctly set a threshold and make better decisions.