Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuse limits range weights from >0 to <1, contradicting the docs #493

Closed
bashunaimiroy opened this issue Sep 21, 2020 · 1 comment
Closed

Comments

@bashunaimiroy
Copy link

Describe the bug

I am receiving the error '"weight" property in key must be in the range of (0, 1)' when using weights that are suggested as an example in the Fuse.js docs, including a weight of exactly 1, or weights of more than 1.

image

image

Version

Version 5.2.3

Is this a regression?

I do not know

🔬Minimal Reproduction

const list = [{
title: "A Bug Report",
author: "Bashu"
}]
const options = {
   keys: [
          {
            name: 'title',
            weight: 2
          },
          {
            name: 'author',
            weight: 1
          }
   ]
}
const fuse = new Fuse(list, options)
fuse.search('Bashu')

Additional context

@IvanDeluxe
Copy link

Hey :)

I've dealt with that problem recently, just do:

npm i fuse.js@6.4.1

For some reason, "npm i fuse.js" doesn't install the latest version...

Wrote about it: #463

Enjoy the weekend! :)

@krisk krisk removed the bug label Oct 24, 2020
@krisk krisk closed this as completed Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants