Hacker News new | ask | show | jobs
by pbw 5768 days ago
This is a logical extension of the trend to do ever more computation on every key press. Think spelling correction and auto-complete. But here instead of just a local process every key press invokes hundreds of remote machines, required to assemble a single search results page. It's impressive and decadant to think your cat walking accross the keyboard can light up whole racks of remote machines.
1 comments

> every key press invokes hundreds of remote machines,

Not really. Apparently Google has an improved cache system for the most common keywords. The pre-computed results come from just one machine.

Yes, but your cat won't hit pre-computed results.
Not really. Personalization, location, etc. affect a lot. I can't find the page I was reading, but it appears that in just running through all the first letters and seeing what is suggested (a is for...) some users are seeing personalized results. And if personalizations are showing up right from character 1, caching results can't really play a big role. Not at the user level anyways; results can certainly be cached further back, but multiple computers will be used just to decide if you deserve personalizations.
The fact that you see location and personalization affects the search result doesn't actually mean that they perform a real search using the query that you are actually writing in your search bar.

One possible way (I'm not sure exactly how it works at google, but I can guess) is that the search result is computed in many steps, one of which searches the indices and generates a list of relevant results, which then are passed to a personalization layer which modifies (reorders, merges, trims) the index results and finally it's passed to a presentation layer which renders the html page (perhaps there are other layers too, irrelevant for this discussion).

So, the "instant" search would basically replace first layer, the actual search in the big indices with a precomputed search list for each phrase generated by search suggestions (or a cache of these, which is filled by actual searches if the element is not present). The personalization layer would be free to do things to that precomputed search results, incurring into smaller load because of several reasons: a) fewer users have personalization and on fewer b) personalization has to access less data, and the whole search retrieve functionality is more IO bound than cpu bound.

As for location, there could be one of these 'caches' per location.

I'm sure that they don't do any query "as you type" because the 'instant' page result is always the result of the first "search suggestion". Try to type "F#" (as user 'singular' suggested), the first suggestion is "f to c", and the search results are about temperature conversion.