docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

sqlite alternative backend support

Open edulix opened this issue 3 years ago • 0 comments

This PR is an initial proof of concept to add support for an alternative sqlite backend using sql.js and sql.js-httpvfs.

This way the search doesn't download the whole search index, reducing network usage, and also not load it in memory, reducing RAM usage. Still, not all the features of the search is supported:

  • Results are not scored, just matched. The search is implemented using FTS3. If using FTS4 or FTS5, we could probably implement scoring and order by score. But right now FTS4/5 is not compiled by default in sql.js and I have not tried to rebuild. Additionally, I'm not sure on how the scoring would affect the query network usage.
  • I've not added yet support for configuring the tokenization, although this is easy to do because FTS3 does support different tokenization options.

edulix avatar Aug 03 '22 16:08 edulix