I am getting incorrect weight/score for my returned matches using ranker=fieldmask. Issue first encountered in v10, and still encountered using latest v15.
Here is my query: SELECT *, WEIGHT() AS weight FROM test_index where MATCH(‘(@npi 1508031618 | (@last_name "Cedeno "/1 (@first_name "Rosa "/1 | @diminutives "Rosa "/1)) | (@entity1 "Cedeno "/1 NEAR/4 "Rosa "/1) | (@entity1 "Cedeno "/1 @diminutives "Rosa "/1) | (@entity2 "Cedeno "/1 NEAR/4 "Rosa "/1) | (@entity2 "Cedeno "/1 @diminutives "Rosa "/1) | (@entity3 "Cedeno "/1 NEAR/4 "Rosa "/1) | (@entity3 "Cedeno "/1 @diminutives "Rosa "/1))’) ORDER BY weight DESC LIMIT 0,10000 OPTION ranker=fieldmask, max_matches=2000;
Using /sql?mode=raw endpoint, I got the attached JSON response: rosa cedeno.zip (918 Bytes)
If you check the responses for prefix: “oig” and prefix: “ga1”, I believe first_name is not being considered in the scoring when in fact, it matches the “Rosa” keyword for that match attribute - meaning additional 2 points to the weight/score of those matches.
if you think that is a bug it could be better to create ticket at GitHub
it also worth to provide result set you got to make sure dev will reproduce the same issue you describing along with expected result as it is not clear what do you describe for right field mask and two additional points
Being the ranker=fieldmask, to compute the weight, we set the bit for each full-text field if it matches, starting from prefix (bit=0). With that, first_name matched ROSA (bit=1) and npi matched 1508031618 (bit=7) in the match() query.
That means, 2 + 128 = 130 should be the weight, not only 128.