@kin Mastodon mainline already has ElasticSearch for server search. Opt-in both for the server and (I think) each user. But it's not a federated search.
Folks have tried to build cross-instance search many times and are shouted down every time. I think it's foolish.