Are algorithms for searching text vs searching numbers fundamentally different?
There is no reason to assume that numbers and words are treated differently: for their servers, both are just strings. Different behaviour would be extra work and I don't see why that would be useful here.

There is one possible explanation for the behaviour you see: maybe they don't search for parts of words!

It is easy to preprocess texts so that finding whole words is fast. Well, looking for any substring is not that much slower (cf suffix trees) but it generates more data to store. Given the amount of data Google deals with, they might have a numbered dictionary and save tuples like (msg_id, position, word_id) (or similar)¹. Storing (matches for) all substrings would cause this data set to explode! (And don't even think about approximate search!)

You can try and verify this by searching not for mango but for ngo -- does it still find your message?




I'm quite sure Google does something far more clever.