krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.76k stars 753 forks source link

Change defaults to `ignoreLocation: true` and `ignoreFieldNorm: true` #753

Closed ViktorQvarfordt closed 1 month ago

ViktorQvarfordt commented 6 months ago

Is there an existing issue or pull request for this?

Feature description

The default is ignoreLocation: false and ignoreFieldNorm: false, this causes basic searches to give very strange results.

Desired solution

Set the default options to ignoreLocation: true and ignoreFieldNorm: true.

Alternatives considered

Make it very clear early in the docs or in the demo that one might want to use these options. I was so close to giving up on this library until I found these options. I just plainly want to fuzzy-search for matches in my strings. I don't expect any location or string length to affect the search by default.

Additional context

No response

leeoniya commented 6 months ago

ignoreFieldNorm: true

nice, this is one i missed in my comparison [1] that definitely improves Fuse's fuzzy results [2]. (added this change in https://github.com/leeoniya/uFuzzy/commit/ec1c44b9bc00332df780c6c48e5f7bcafddc941a)

[1] https://github.com/leeoniya/uFuzzy?tab=readme-ov-file#a-biased-appraisal-of-similar-work [2] https://leeoniya.github.io/uFuzzy/demos/compare.html?libs=uFuzzy,fuzzysort,QuickScore,Fuse&search=super%20ma

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days