Closed abenhamdine closed 4 years ago
Oops. Docs were prematurely updated for v6.x, which isn't out yet in latest
but will be soon.
In v6.x you can set weight
to any value >= 0, and you can mix and match. Code is in the next branch.
Pull in the beta version: 6.0.0-beta.0
.
Oh we have been spoil :p Thanks for the work :)
Oops. Docs were prematurely updated for v6.x, which isn't out yet in
latest
but will be soon.In v6.x you can set
weight
to any value >= 0, and you can mix and match. Code is in the next branch.Pull in the beta version:
6.0.0-beta.0
.
Thx for your answer and your useful module. It's indeed often difficult to synchronize docs and code ;)
Now in the latest version. Will close this.
Describe the bug
1°) Docs here say we can set weights >1, they will be normalized : https://fusejs.io/examples.html#weighted-search
But if I search with following options :
I get that error :
due to that check https://github.com/krisk/Fuse/blob/eff9ad9cf783f5506aacc09496dfc06ea6e3c5bd/src/tools/KeyStore.js#L39
2°) Also the docs say keys wich are string only are normalized with a weight of 1, but according the same code, the type of the keys is determined based on the first key of the array, see https://github.com/krisk/Fuse/blob/eff9ad9cf783f5506aacc09496dfc06ea6e3c5bd/src/tools/KeyStore.js#L12
therefore I fail to see how it could possible to mix string/object keys with weights...
Version
5.2.3
Is this a regression?
I don't know
🔬Minimal Reproduction
search anything with these options :
Workaround
Normalize keys as following before passing to fuse search :