3 ms·
This is perfect for my need, been looking for a way to add search to my static site completely free of server. Now I can use sqlite as index.
by nsonha 6y ago
This is perfect for my need, been looking for a way to add search to my static site completely free of server. Now I can use sqlite as index.
- Benjamin_Dobell 6y agoThis certainly does look like an interesting solution, I'd be keen to try it myself. However, just in case you didn't already know about Lunr (https://lunrjs.com/ https://lunrjs.com/), it is fairly commonly used to implement search on static websites. e.g. https://squidfunk.github.io/mkdocs-material/ https://squidfunk.github.io/mkdocs-material/ There are of course other similar libraries too. EDIT: Whoops, just saw a few comments below Lunr is already mentioned.
- nsonha 6y agoyeah I have come across Lunr and maybe a couple of other things in my research and I think for blogging it'll work well. What I'm interested in finding out is what works for a larger static site, that won't require you to load the index up-front. I'm also curious about how this sqlite thing picks the correct range to load (haven't looked at the code) and what the worst case might be.
- masklinn 6y ago> I'm also curious about how this sqlite thing picks the correct range to load Indexes are usually btree, it finds what and where the relevant index is (probably from the schema queries), then goes trawling through the b-tree. That’s how db engines normally work, they don’t liberally go through the entire db contents. If there’s no index then it finds the start of the table and scans it sequentially (which is exactly what it sounds like).