Show HN: Frontend Fuzzy Search
120 points| kmschaal | 2 years ago |github.com
The implementation is based on 3-grams by the book, augmented with a novel trick of sorting the characters within the 3-grams for enhanced accuracy. For a detailed explanation you may refer to my related blog post at https://www.m31coding.com/blog/fuzzy-search.html.
Happy Coding!
trescenzi|2 years ago
It’s not nearly as good a fuzzy search as this is as I just kinda tinkered with it till it felt ok for the purpose but it could be way better.
Source: https://github.com/trescenzi/brainstorm Site: https://brainstorm.tcrez.xyz/
kmschaal|2 years ago
jwr|2 years ago
zodvik|2 years ago
RoyalSloth|2 years ago
Context: Say I have a bunch of blog posts from which I create an inverted index at "export to html" time, in order to avoid indexing the blog content at runtime on every page visit. Is there a way to persist the internal state of the fuzzy search across different page requests (e.g, /blog-post-1, /blog-post-2), so it only builds its internal state/index once?
The pre-generated inverted index could be quite large and I would like to avoid parsing it on every page request.
kmschaal|2 years ago
Kalabasa|2 years ago
http://elasticlunr.com/
terpimost|2 years ago
Most importantly very few fuzzy search libs can get a simple substring match as a priority, which is understandable but not helpful. Imagine searching for “xample” and not having “example” among the results.
kmschaal|2 years ago
metayrnc|2 years ago
kmschaal|2 years ago
newusertoday|2 years ago
kmschaal|2 years ago
tkcranny|2 years ago
I’m curious if there’s a tl;dr on how this is better or different to Fuse, which is a very popular established client side fuzzy searching library.
https://github.com/krisk/fuse
kmschaal|2 years ago
swyx|2 years ago
si1entstill|2 years ago
giovannibonetti|2 years ago
[1] https://duckdb.org/2023/12/18/duckdb-extensions-in-wasm.html
_heimdall|2 years ago
I have always been a bit unsure when to reach for client-side code for festures like search, filtering, and pagination though. The features are powerful for sure and if the site is otherwise static I can see some value there, but it means having to ship all searchable data to the browser. It feels like an easy security risk to avoid, and offloading that work to a backend where the state lives feels more straightforward (as long as you have a hosted backend at all).
jdthedisciple|2 years ago
efilife|2 years ago
lacoolj|2 years ago
Keep up the great work!
kmschaal|2 years ago
henio|2 years ago
kmschaal|2 years ago
leeoniya|2 years ago
i will add it to the uFuzzy benchmarks :)
unknown|2 years ago
[deleted]
Gord1419|2 years ago
[deleted]