Google has launched a beta of their new "Google Suggest" search page. This borrows a page from their GMail service in that as you begin to type in the search box, suggestions present themselves (ala intellisense style) based on current page rankings for queries matching the letters typed in. At first glance, the response elicited should be along the lines of "tres cool", but the deeper question should be "how is this accomplished without postbacks to the server?" For GMail, this would be easy enough as all suggestions are predetermined based on entries in your address book; i.e. each of the entries could be stored in a javascript array...as each letter is typed in just enumerate over said entries and do a char by char comparison. It goes without saying that this would be entirely impractical for something as vast as a search query whereby what is typed in simply cannot be predetermined by any (practical) means.
This comment on /. gives a reasonable answer...I haven't taken the time to pick through the javascript mentioned in the comment yet, but like all things that seem complicated and undoable, I'm sure the answer is quite straightforward and simple (hindsight is always 20/20). This is good stuff though. Homepage == Google Suggest.



No comments yet