Here's how a Dropserver app for searching a static site could work:
- a route behind token auth that Netlify (or whatever builds your site) calls after a new version of site is deployed
- after that route is called, app fetches the content json and generates an index, which gets stored in appspace data dir.
- a public search endpoint that leverages the index to return search results
- private route(s) for the appspace owner where get/set the url of the content json, and last fetch date
2/
Oh there is also fuse.js for which there is a Deno package already:
Some notes on search libraries for dropserver after spending a few minutes looking into it:
- lunr.js was the old go-to but seems no longer supported. Was awkward to use in Deno especially in TS file.
- Stork looks intriguing: https://stork-search.net/ but have not tried. WASM indicates should run fine. Currently being worked on.
- I'd also try loading the content into a sqlite DB and use the FTS5 module. Big advantage is not needing to load entire index in memory to search (I think?)
3/3