Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Google, YouTube etc live search. How?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #24971
    mattvot
    Member

    Does anyone know how Google.com Youtube and twitter do their live search. You know, where they predict what your typing?

    And a practical way of duplicating the effect?

    #58419
    csscoll
    Member

    Twitter searches the media that people are sharing on twitter. so it’s like performing a google search but limited only to the part of the web that people are sharing links to on twitter.

    For google search you can refer to this link

    #58583
    Hugo
    Member

    I think he means the ‘AutoComplete’, those are the suggestions that pop up right under the input field.
    The way google (and other websites) do this is by using AJAX – every time you press a key (hence: typed a letter) while focused on the input field, the google page does an XMLHTTPRequest to a server, and the response of the server is used to ‘predict’ what you’re going to search for.
    In human language: Say you typed the letter H into the google search field, a request is sent to a page on the google server, and this page searches the database for everything that begins with an H. Finally, it returns the results to ‘your’ page showing the suggestions – everything the server found that starts with H (most probably limited to 5 or 10 results or so). Same goes for when you type more, so when you typed an U after the H, google’s server will look for anything that starts with HU. This all happens in about 1/10th of a second.
    Using the Firebug extension you can see the requests that google performs ‘around your back’:

    [img]http://img14.imageshack.us/img14/5822/exampleucr.th.jpg[/img]

    Hope this answers your question (I found this very interesting as well someday)

    #58593
    mattvot
    Member

    Thanks, That’s the answer I wanted!

    So it searches the whole database? It seems like that would require alot of processing. DO you think they cache different combinations?

    #59504
    Hugo
    Member

    Yes they certainly do cache certain combinations, depending on your language. They also have an entire database containing a lot of possible typo’s for each word, so they autosuggest stuff even when you’ve spelled it wrong. This indeed costs a lot of processing, but then again: google has a ton of servers with a lot of processing power.

    #59535
    mattvot
    Member

    i see…

    thanks for the help, but this now seems a feature too complex for my simple mind. ha

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Other’ is closed to new topics and replies.