Mastodon 4.2 release will be a major milestone for all of fedi. When the biggest server flavor enables toot search and settles on a privacy declaration to make it opt-in, that settles the argument on whether global search is okay here or not: it will be.
In the past year, a lot of projects to do this exact thing have been killed and people banished for it, but that's the price for spearheading change.
However, no Mastodon server sees enough of fedi to actually provide global search - not even mastodon.social, and certainly not whichever site you are registered on. They can only index the part they see, after all.
So, the next step on this path is a global search service provider subscribing to ALL servers (modulo moderation). Running one will be a very expensive operation, though - funded either by ads, or by (server admin?) subscription.
Would you pay to have access to global fedi search?