question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Score is not working correctly

See original GitHub issue

Hi,

in last version 3.6.1 the score is not between 0 and 1. This can be check on https://fusejs.io/ too.

Example request + config:

  shouldSort: true,
  includeScore: true,
  threshold: 0,
  location: 0,
  distance: 0,
  maxPatternLength: 32,
  minMatchCharLength: 1,
  keys: [
    "title",
    "author.firstName"
  ]
};
var fuse = new Fuse(list, options); // "list" is the item array
var result = fuse.search("Old Man's War");

the output:

[
  {
    "item": {
      "title": "Old Man's War",
      "author": {
        "firstName": "John",
        "lastName": "Scalzi"
      }
    },
    "score": 2.220446049250313e-16
  }
]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
acnebscommented, Apr 16, 2020

Yeah, this broke my logic and took me a while to debug. The docs should definitely be changed if an exact match is no longer strict equality 0.

@MadsMadsDk I’m not sure that is the best way to do it, as partial match scores can be as low as 0.001, which with your fix would be cast as “perfect” even though it’s not quite.

I’ve gone with this for the time being:

const perfectMatch = result.score < 1E-10;

But I think it would be very good to have a solution with a strong guarantee when a result is a perfect match.

0reactions
kriskcommented, Apr 19, 2020

Addressed this in v5.2.2-alpha.0.

However, I’m undecided about this. I’ve started a discussion in #397.

[Will close this and use the above issue instead]

Read more comments on GitHub >

github_iconTop Results From Across the Web

is Score not working / having issues for you? - mwallpapers
Score app Notifications are not working properly.​​ Go to your Apps->Score->Notifications and check whether notifications enabled or not. If it is not enabled, ......
Read more >
is Score not working / having issues for you? - 99images
Try Hard reboot in your Android mobile. Press and hold down the "Home" and "Power" buttons at the same time for upto 10...
Read more >
General Troubleshooting - forScore | Support
Open the tools menu and choose Backup. Create a new backup file by tapping the + button in the upper right corner (if...
Read more >
assembly 8086 - score isn't working properly
Are you sure that you're saving the scores correctly? Have you run the code in the debugger to see what's in [Score1] and...
Read more >
Troubleshooting - PlayScore 2
In case of scanning problems the Status (tap the cogwheel) will show more information. If the problem is in a photographed score, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found