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…
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…