Hi, I work on a variety of things, most of which I talk about more on my blog than on social media. Here, you’ll probably find me talking mostly talking about Free Culture works and sometimes technology.
In addition to YaCy and the varieties of Searx (both of which perform better for me than any of the commercial search engines), it’s not even out of the question to do this yourself, if you’re willing to start with the most recent Common Crawl dump and do some spidering in between releases. I don’t recommend it, unless you want to learn for yourself why search engines often give such miserable results, but it’s possible.
However, that’s the issue, here. Can you self-host a search engine? Sure, if you want to maintain the storage to back it. That depends on how deep your pockets go…
It’s not as clean a solution as they’d like it to be, but for another option, Jellyfin hosts media including books. When I say “not as clean,” I mean that you can stream video and music from the server, but it has you download books to read on another device. Last I heard, they were looking to integrate at least a PDF viewer into the interface, though.
My half-solution to this has always been to refer to where I’m working in my notes, like a file, method name, and maybe control structure if warranted. I’ve never needed to take that final step (hence half-solution), but this carries about enough information that someone could hack together a quick program to merge the notes and code in a reasonable way.
While (as I say) I’ve never specifically needed it, though, at work I’ve often wanted to do that and take the next step of sifting through version control, the ticketing system, and team chats to pull a complete view of what’s been happening around a particular chunk of code. I point that all out, because I think that you’re on the right track, however you ultimately solve that problem for yourself.
The Indie Web website up there actually has protocols to do most of what people do for social media, in exactly that structure. It’s enough of a pain to set up that I don’t see it becoming normal, but the amount that I’ve set up for my website at least works…