Skip to content

Releases: thesephist/libsearch

First release 🙌

21 Jul 15:07
Compare
Choose a tag to compare

libsearch, like blocks.css, is me pulling out an often-used piece of code from across many of my projects to make it available as a library for everyone (including my future self). It lets me add simple, "good enough" full-text search to client-side web apps without having to build and maintain search indexes. It has a handful of well-chosen features I've found useful over time:

  • TF-IDF ranking
  • Opt-in case sensitivity
  • Search modes that control how partial matches are processed, including an 'autocomplete' option that works well for most use cases

It's not the fastest or the most feature-packed out there, but if you just need to let the user search for some text in a web app, up to a corpus of a few megabytes, libsearch is probably what you're looking for.

The algorithm here is in use in websites like ycvibecheck.com, and the library itself is used in e.g. linus.zone/entr.