I made a plug called Silversearch (don’t judge my creativity) implementing a fulltext search for Silverbullet. It’s basically a port of Omnisearch from Obsidian if you ever used that, although it doesn’t have feature parity with Omnisearch yet.
The install instructions and config options are on github. There are probably still a few bugs right now as I have ported a lot of stuff directly and not yet tested every setting and every combination of settings. So if you encounter something feel free to open an issue.
There are a few SpaceStyles you have to set as mentioned in the docs. I will create a pull request soon (hopefully) to change that in Silverbullet directly as I see no reason for those styles.PR to integrate those into Silverbullet
I’m also thinking about indexing PDFs and images, but I’ll have to think about it/talk to @zef on how to best achieve this, because there are a few limitations with plugs. After some more research I think the limitations I thought existed, don’t actually exist.
This looks very promising! Thank you for making it and sharing it!
The lackluster search is honestly one of the worst features of SilverBullet. Something like this should really be baked-in. Maybe we’ll get there some day!
Just installed this and it works… really well and fast. Cool! Weird thing that seems to happen on my install is that the search input box is not showing the cursor (Chromiun, macOS) anybody else seeing this?
I’d like to have a closer look at the implementation. A quick look suggests that this stores the entire search index in a single database key, is that right? I wonder how well that scales.
It keeps the minisearch instance/class as a global variable in the worker and just caches it into the clientstore after every change (indexing). When it’s used it checks if the variable in the worker is still initiated and if not loads it again. So it only really has to load stuff it the worker is suspended.
Searching works like charm but the page content disappears. It’s not like in your screenshot above, when I spawn the Silversearch I see only the Silversearch dialog and the page “under” is hidden. Is that intended behaviour? (Firefox 137 on Linux)
Just had a look at the code. Very interesting mix of tech (some node.js and vite, some svelte, some Deno) Pretty amazing you got it to work.
It looks like indeed the entire search index is kept in a single key in the DB. In my space with about 1.6k pages this takes up >5MB of JSON but somehow this just seems to be fine and pretty snappy! I’m surprised to be honest. Perhaps the whole full-text seach indexing thing I built (which is way worse in terms of result quality) was way over engineered compared to what is actually needed.
I have used this architecture of Deno + Nodejs Vite multiple times now. It’s pretty annoying to set up, because Deno just sometimes does weird stuff like use your package.json instead of the deno.json, but once it works it’s pretty flawless. It’s also really the only option here as Deno building frontend code is a massive pain as you know from silverbullet itself. Especially when you want to extract css and stuff. (I still don’t understand what the recommend way here is instead of using something like fresh. Frontend doesn’t seem to be a concern for Deno devs)
I haven’t really tested it on super large spaces myself, but yeah, it’s surprisingly snappy, I think it really speaks volumes to how optimized browsers are with core operations like json parsing.
Generally I would have no problem with it being merged into Silverbullet, but I really don’t have a lot of choice with the licensing. Omnisearch is GPL (Don’t really know why, maybe to prevent the obsidian devs from yoinking it) and I took large code snippets and “algorithms” from Omnisearch, so yeahh … Rebuilding this completely with the same features would probably take waaaaaay more time when I spent to build it now and would also cause a lot more bugs. (also it’s like 600+kB, which is not super great reduced it to ~300kB)