{"by":"leeoniya","descendants":82,"id":33035580,"kids":[33041722,33045896,33041649,33042869,33041619,33045459,33050846,33042854,33041428,33042905,33042979,33094440,33045194,33048707,33044847,33042147,33044783,33044137,33042345,33044957,33045349,33041492,33043914,33035581],"score":251,"text":"Hello HN!<p>I became frustrated with the unpredictible&#x2F;poor match quality and opaqueness of &quot;relevance scores&quot; in existing fuzzy and fulltext search libs, so I tried something different and this is the result. The main selling point is the result quality &#x2F; ordering, with best-in-class memory overhead and excellent performance being bonuses. The API is pretty stable at this point, but looking for feedback before committing to 1.0.<p>TL;DR<p>The test corpus is a 4MB json file with 162k words&#x2F;phrases, so give it a second for initial download. You can also drag&#x2F;drop your own text&#x2F;json corpus into the UI to try it against your own dataset.<p>Live demo&#x2F;compare with a few other libs (there are many more in the codebase, in various states of completion, WIP):<p><a href=\"https:&#x2F;&#x2F;leeoniya.github.io&#x2F;uFuzzy&#x2F;demos&#x2F;compare.html?libs=uFuzzy,fuzzysort,QuickScore,Fuse&amp;search=super%20ma\" rel=\"nofollow\">https:&#x2F;&#x2F;leeoniya.github.io&#x2F;uFuzzy&#x2F;demos&#x2F;compare.html?libs=uF...</a><p>In isolation for perf assessment:<p><a href=\"https:&#x2F;&#x2F;leeoniya.github.io&#x2F;uFuzzy&#x2F;demos&#x2F;compare.html?libs=uFuzzy&amp;search=super%20ma\" rel=\"nofollow\">https:&#x2F;&#x2F;leeoniya.github.io&#x2F;uFuzzy&#x2F;demos&#x2F;compare.html?libs=uF...</a><p>To increase fuzziness and get broader results, try setting intraMax=1 (core) and enable outOfOrder (userland):<p><a href=\"https:&#x2F;&#x2F;leeoniya.github.io&#x2F;uFuzzy&#x2F;demos&#x2F;compare.html?libs=uFuzzy&amp;outOfOrder&amp;intraMax=1&amp;search=super%20ma\" rel=\"nofollow\">https:&#x2F;&#x2F;leeoniya.github.io&#x2F;uFuzzy&#x2F;demos&#x2F;compare.html?libs=uF...</a><p>Also play with the sortPreset selector to swap out the default Array.sort() for one in userland that prioritizes typehead-ness (the resultset remains identical).<p>Still TODO:<p><pre><code>  - Example of stripping diacritics\n  - Example of using non-latin charsets\n  - Example of prefix-caching to improve typeahead perf even further\n  - Example of poor man&#x27;s document search (matching multiple object properties)\n</code></pre>\nThat&#x27;s all, thanks!","time":1664549089,"title":"Show HN: uFuzzy.js – A tiny, efficient fuzzy search that doesn't suck","type":"story","url":"https://github.com/leeoniya/uFuzzy"}