I only just learned about this, so haven’t signed up or checked out the communities and therefore won’t endorse it, but Codidact just came across my desk. https://codidact.com/
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.
I only just learned about this, so haven’t signed up or checked out the communities and therefore won’t endorse it, but Codidact just came across my desk. https://codidact.com/
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…
Probably, though I don’t know their architecture well enough to say. The discussion that I saw referred specifically to PDF.js, which I believe is what the browsers use, though.
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.
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…