-
Notifications
You must be signed in to change notification settings - Fork 19
Implements fuzzy searching #166
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly nits. Curious if there was any process to you selecting this library. I have no preferences though
I was looking for something simple and lightweight. Fuse was too large and complicated, ts-fuzzysearch wasn't updated in years, others didn't have an npm package or it was outdated aswell |
About the PR
Implements fuzzy searching using https://github.com/Nozbe/microfuzz
Fuzzy searching, or approximate string matching, is the technique of finding strings that mach the pattern approximately rather than exactly, which makes it easier to search for strings in a large array of data, even by fragments. "wo chai" will find "
wo
odencha
ir" while in smart mode and "wo
bblecha
mber li
d" while in aggressive mode.Demonstration:
2025-05-11.02-26-33.mp4
Why's this needed?
A lot of interfaces that provide searching for entries will benefit from this.
Implementation
useFuzzySearch
is a hook that accepts an array of items and returns a matched array any time thesetQuery
hook is updated. Below is a simple showcase: