Google Suggest, how does it work?

How does Google Suggest work? How can I quickly update a web page on a client based on information in a remote Google database? Why doesn't a webpage look β€œnervous if it is updated frequently?”

+4
source share
3 answers

It uses AJAX.

When you write your query, it searches for the 10 most requested words that match yours. It then writes a miniature JSON to an invisible DIV element. Fast, but still resource intensive.

Try installing Firebug on Firefox or using the Developer Console in Chrome, open the console and start writing "Youtube" or whatever. You will see minimized JSON responses.

Good luck: D

+8
source

In addition to the front-end processing that others have mentioned that jQuery is a great example, you might also be wondering how they approach the idea of ​​a backend. Dr. Peter Norwig wrote about how to create a spelling corrector , where similar approaches can be used to find close matches.

+3
source

The whole page is not refreshed. Only parts of it use AJAX - asynchronous Javascript and XML. Ajax requests can be made in Javascript, and the page is refreshed when the response is returned.

A more interesting question is how Google actually searches for 10bn + documents in a tiny fraction of a second :)

+1
source

All Articles