It just matches terms literally and shows matching emails in chronological order. It doesn't do ranking and non-literal matches like web search does. I think this is the right way of doing it.
Also, the gmail team has to work with a lot of restrictions because of privacy. They are not allowed to look at user's email ever. That would make it hard to do ranking.
Maybe this helps: https://support.google.com/mail/answer/7190?hl=en
Gmail search isn't bad, it just is using a less complete set of signals to intuit what you're searching for. It's more of a "garbage in, garbage out" model than a "we can intuit what you want based on how millions of other people have reacted to the results of this query." That's because you're the only one searching against this data set (your email).
What's an example of something you've had trouble finding via search? There might be better ways to conduct your search. I've lived for 10+ years with my primary organization strategy being to rely on Gmail search, and have found it extremely effective.
Must admit though, searching is always a bit of a pain, sometimes I can't seem to find emails that I know for sure are there, and after some browsing I'm able to find them.
There are a few advanced search operators that should be there that are missing, like finding the threads with the most number of messages. And the APIs are missing some functionality also, but overall it seems to work pretty well.
It seems like there is rich data to train a model on: graph of shares between the org, comment activity, time open, collective time spent writing, etc.
The fact that is it literal matches only seem inexcusable. Sure, the magically ability to guess what your meant isn't going to be available when you're the only one searching your database and there are privacy restrictions, but even just basic spellcheck or near matches would be extremely useful.
There are some search tricks you can employ from the desktop to help finding stuff easier (e.g. narrow by date) so I'd recommend you use these on desktop to try to locate what you need. When you find it, apply a tag to make finding it easier in the future.
https://business.tutsplus.com/tutorials/how-to-search-your-e...