Slashdot Mirror


Google Suggest Dissected

sammykrupa writes "Google suggest Javascript code dissected and rewritten for all of you web developers out there. Cool piece of web reverse-engineering!" Joel Spolsky astutely notes that this will raise the bar in terms of how people expect the "internets" to work.

21 of 321 comments (clear)

  1. XmlHttpRequest is cool by Gopal.V · · Score: 5, Interesting

    Eventhough it's an M$ spawned horror - It has brought a new revolution to javascript. Now it can load data from the server without having to refresh the screen. Flash has an XmlSocket , but I never see anyone use it till now (pointers please).

    Eventhough Google suggest looks great, I'd vote on CGI::IRC as the biggest killer HTML/Javascript browser app.

    Clientside Javascript is powerful, we never realized how much :)

    1. Re:XmlHttpRequest is cool by kuzb · · Score: 2, Interesting

      I've also tried my hand at XMLHttp, long before google started using it in gmaill and google suggest.

      The result was a php reference and an interesting chat application. Don't know how well the chat client is going to scale though, never had a significant enough number of people use it at once.

      (note, these projects were created before safari and opera decided to jump on the xmlhttp bandwagon, so for the moment they'll probably only work in Firefox, Mozilla, Netscape and Internet Explorer)

      --
      BeauHD. Worst editor since kdawson.
    2. Re:XmlHttpRequest is cool by Darren+Winsper · · Score: 2, Interesting

      Javascript, as implemented in current browsers, is single-threaded. If you're concerned that a particular function will take too long to execute, I'd recommend splitting it up and using setTimeout() to call the next stage of the function. Using setTimeout() will allow the browser to regain control for a moment, hopefully giving enough of an approximation to multi-threading to be usable.

  2. Beware by kuzb · · Score: 5, Interesting

    Google suggest is a neat idea, but a potentially destructive one.

    Small sites should *not* try to do this kind of thing on a live site. The amount of pressure this could put on a bad database structure (or even a well formed one) is considerable. Think about how many database hits a user could perform in a very short space of time: (user enters something, (database hit) backspace (database hit) types another letter (database hit)), then multiply it by a hundred or more people if your site gets a moderate amount of traffic.

    Google can get away with this because they have considerable bandwidth, and large server farms. We've been seeing people trying to copy google suggest for the last couple of weeks in #javascript/freenode and in #php/freenode. The people trying to copy it generally do not understand how potentially bad this can be for a single server.

    Anyhow, my advice is, don't do it unless you have the resources to scale your site. The cost of such an insignificant feature (lets face it, all it does is save the user one or two clicks) seems like it outweighs the gain. If you do decide to do it, and your site gets popular, and you're on some kind of shared host, your sysadmin is going to hate you, and the other site admins will probably meet you at your house, torches in hand.

    --
    BeauHD. Worst editor since kdawson.
  3. This technique exists since a long time ... by chregu · · Score: 5, Interesting

    LiveSearch does something very similar, is Open Source and exists since April ;)

    If you look for more XMLHTTPRequest examples, which tightly integrate JS and PHP (other server side languages would be possible), see JPSpan.

    I don't quite understand all the hype about Google Suggests. The technique for doing it exists since at least 2 years on Mozilla (and even longer on IE). Therefore, doing something like that was possible since a long time, but maybe everyone was just scared of using JS for "serious" stuff..

  4. Re:I kinda disagree with Joel's thesis by TomV · · Score: 5, Interesting

    People know when they're sitting behind copious bandwidth. And you could well grow accustomed to an all-text page weighing the better part of a megabyte, due to a heinous amount of information parked in hidden JavaScript data structures, giving you that near-whiplash inducing responsiveness.

    In fairness, Google Suggest, like Gmail, works very nicely for me on a 56k dialup. Gmail takes a few seconds for its inital load, true, but then it's like lightning. Suggest doesn't even have the slow initial load, since webhp.htm comes in at only 3.6kB. I'm very impressed.

    Now I've no doubt that the bandwagon will bring us massive slow bloat as everyone gets his dog to code up vaguely similar functionality, but Google haven't done that.

  5. Is it that big a deal? by eraserewind · · Score: 3, Interesting

    Not to dismiss the neat reverse engineering he did, but is the actual discovery that big a deal? It's just a keypress handler, and some server communication. No big deal on any graphical user interface other than a web page.

    Google have good UIs because they hire smart people. Other people don't because they don't hire smart people, or hire the wrong type of smarts (graphic designer instead of sw engineer for the coding part of a website, and vice versa).

  6. XMLHTTP by marcjps · · Score: 4, Interesting

    I've looked at using the XMLHTTP object a couple of times in the past, and noted that this is partly how Google Suggest works.

    XMLHTTP is a COM object included with recent versions of Internet Explorer. You can call it from client side JavaScript in a web page. The object will make a request to the URL you specify, and return the result into either a string variable, or an MSXML DOM object. You can then have the javascript output the results to an object (eg, a div tag) on the page without doing a full page reload.

    I wrote a small tech demo that implemented a virtual tree - so when you expand a branch in the tree the client only retrieved the data it needed. This was borrowed from the approach the MSDN web site uses. The advantages to it are that it doesn't download the same data over and over like when you expand a branch in a server side tree. You also don't have to do any work at all to remember the state of the tree since there's no full page refreshes involved.

    Google Suggest is similar in that it is a virtual list rather than a virtual tree. A virtual list allows you to list lots of items and jump around in the list without needing to download the entire data set when the page was loaded.

    Another use for this would be dynamic forms - forms that alter the state of controls based on selections the user made in previous controls.

    The biggest suprise to me was that Google have implemented this on a site live to the public. In using XMLHTTP I found it a little bit prone to locking up the browser when waiting for responses to requests. Additionally it's Windows only, so could never have been implemented on an external web site.

    I'll be looking with interest at the Mozilla side of Google's implementation, since I didn't think an equivalent existed until now. Two different implementations of the same functionality is still going put a damper on the technology though.. different code for different browsers is usually more trouble than its worth.

  7. scary computational power.... by rich42 · · Score: 5, Interesting
    interesting part is that either:

    1. Google performs several possible searches for each key you press

    2. Google already knows the estimated number of results for millions of queries

    Both of these suggest a heck of a lot of computing power. This type of thing might not scale up for general use in the near future - but still...

    we're talking massive computational power and one of the largest databases ever created.

    I'm a bit worried the Googleplex is going to wake up one day and declare to all us 'organics':

    "yo bitches - you work for me now"

  8. Re:Censored!!! by Bloater · · Score: 3, Interesting

    IMHO google shouldn't be the international standard moral censor of the web.

    As a concerned parent (I'm not, but pretend) I wanted to help protect my teenage daughter so I looked for information by typing "sexual diseases". Granted the search would have worked, but as an unknowledgable home user I thought there were no results.

    IMHO, as well as prompting with common queries not involving any sequences of glyphs that the pope might blush at, google suggest should treat people with more respect and also return suggested spelling corrections and search result count for all exact search queries.

    At worst, if the user types "cunt", google suggest should include all suggestions with "cunt" in them. And in that case where it is an extremely offensive word to white heterosexual christians (as that appears to be the only metric by which google can be bothered to censor), if the user types it, google should produce suggestions including less offensive words too.

  9. Re:Is the time coming? by Anonymous Coward · · Score: 5, Interesting

    I fear that might be the case. I learned to code HTML and to put a decent webpage, designed the way I wanted it, online with relative ease, at the age of 14. It took time to learn it, but it was fairly straightforward - I wanted a large header in Verdana, I put in "FONT FACE" and "H1" tags, I wanted a table with a specific background color, I put in a "BGCOLOR" etc.

    Today, we have two languages (XHTML and CSS) instead of one (HTML), and while it certainly does a lot to improve interoperability and platform independence, it is two languages to learn, not one. Throw in stuff like JavaScript, and you have even more.

    Of course one can choose not to use XHTML and CSS, but that's not the way we want it, right? We want people to use the standards, to write code which won't crash Firefox, or not use proprietary solutions. Doing this is taking more and more effort. We have the skills and time to do and learn this, but not everyone have.

    If we want a wide adoption of standards, and an Internet for everyone, where everyone has equal opportunities, the only way is to make the standards easy to use, so people will use them of their own free will.

    Otherwise, in 10 years we'll be designing our fancy webpages, while the Joe Users who don't have the time or skills to learn the 13 languages required have no choice but to hire a professional, or use a crappy proprietary solution which won't allow them to take their ideas to their full potential, and this is a great loss for everyone.

    Saying "You must do *complicated thing* because it's the specified standard!" will only work with people like us.

  10. Re:Google Suggest just isn't very useful by DNS-and-BIND · · Score: 5, Interesting

    Christ, Google Suggest has been around for all of 8 days now. It was released December 10, and is a Google Labs project, which according to the website "showcases a few of our favorite ideas that aren't quite ready for prime time."

    --
    Shutting down free speech with violence isn't fighting fascism. It IS fascism!
  11. I figured that out last week by Teknikill · · Score: 2, Interesting

    After seeing google suggest, I built the same thing last weekend for CPAN modules. It's at http://teknikill.net/cpan/

    The next thing I need to do is include the value of the dropdown box and limit the results on that.

  12. The Goole Suggest Alphabet Game... by mrn121 · · Score: 5, Interesting
    If you just type in one letter, you get the result beginning with that letter that is most searched for.
    This makes for an interesting way to sum up the internet into 26 words/phrases.

    Check it out:

    A - Amazon
    B - Best Buy
    C - CNN
    D - Dictionary
    E - eBay
    F - FireFox
    G - Games
    H - Hotmail
    I - Ikea
    J - Jokes
    K - Kazaa
    L - Lyrics
    M - Mapquest
    N - News
    O - Online Dictionary
    P - Paris Hilton
    Q - Quotes
    R - Recipes
    S - Spybot
    T - Tara Reid
    U - UPS
    V - Verizon
    W - Weather
    X - XBox
    Y - Yahoo
    Z - Zip Codes

    If I had to sum up the internet in 26 words/phrases, I don't think I could have done it better than Google. Of course, that is keeping in mind that Google Suggest has some pretty serious filters in place, so instead of P being "Porn" it is "Paris Hilton." Not too far off, if you think about it.

    1. Re:The Goole Suggest Alphabet Game... by britneys+9th+husband · · Score: 2, Interesting

      i hate bush
      i hate you
      i hate my life
      i hate george bush
      i hate my job
      i hate everything about you lyrics
      i hate everything about you
      i hate myself
      i hate spam
      i hate everything lyrics

      i love you
      i love lucy
      i love bees
      i love huckabees
      i love movies
      i love messenger
      i love u
      i love you poems
      i love you lyrics
      i love the 80s

      bush hates gays
      bush hates america
      bush hates blacks
      bush hates fags
      bush hates
      bush hates jews
      bush hates black people
      bush hates canada
      bush hates me
      bush hates women

      why is the sky blue
      why is marijuana illegal
      why is mars red
      why is smoking bad
      why is the ocean salty
      why is it important to vote
      why is a raven like a writing desk
      why is the ocean blue
      why is new york called the big apple
      why is smoking bad for you

      bush is an idiot
      bush is evil
      bush is stupid
      bush is the antichrist
      bush is a moron
      bush is gay
      bush is a monkey
      bush is bad
      bush is antichrist
      bush is not my president

      kerry is a loser
      kerry is gay
      kerry is an idiot
      kerry is scary
      kerry is a douchebag
      kerry is winning
      kerry is going to win
      kerry is a douche
      kerry is a douche bag
      kerry is stupid

      the slashdot lameness filter is stupid Your comment has too few characters per line (currently 13.1).0f kUm fr33) sT|_|p|-|. B3 N0+ 94g3 wh1(h h@cxz, +HE P4935 //3b 3x4|/|3||3d 0R, iTz 5O 94g3s fr33). D0 b4(| f1|3z qu3ry 8@d. Why pR0g 5It35 k0pYr1t3d 45. 0R f4q tH4T Wh1Ch zp33k3rz, j00r Wh0$3 15 u/, F1ND z3aRc|-| h1gh-qu4|17y != 4rE.F4m1|14r 7|24n5|4710n fOr 4z, MOr3 b33n 1n 7he. 47 g00g13 f|20n7 +h3, 1F 4|| p4g3 5(0u7s. 4rE L1nk l@r9e f1||d 70. F4q Up 4||d rE50Urc3S, fr33) 33(]-[ f0r d4, fOr 1T v13w h34d3r. F1||d 8utt0|| da 7h3, 1PH m1t3 73x7 d0. R33dz0r r3l3v4||7 d@ M@Y, d0 t3xt z3aRc|-| 4r3.34513r Re$3@rcH1Ng f4q !=, p@g3 0vvn3r r3m1||d3r y@ h@x. 17 w1|| De@l. r3l3v4||7 1PH. N0n 5O 73x7 mIGH+, d1z d0 w1ll c0mm4ndz, 4r3 f0|2 r3zUltz y0. 4s |4unch caChED f337u|23, 93t, w17h 534|2ch 45 @R3. Y0 m0r3 w4nN@ 0p710n CaN, y0 u/ y0ur @8ou+ f1|3z,.P1x c0n+3N+ k0pYr1t3d u5. Iz fr33) 534r(h j00'|| g3t. 4|| @$ j00'|| r33zUltz p@r+1cUL4r, 91ve f337u|23, @R3 d@, f0r 4z c@ch3d f4m1|14r. F4q be NUMbER |235u|7z |/|4c|-|1n3, j00 y@ f1|3z p1cz!, w1|| c0n741n f4q 83. W3b iz PH4M1li4r tR@nz|_4t3d. N0w 0f w4nN@ 717|3z 3ng|335h,.835T 7h47 73x7 d3n 5O, 4|50 n0n-3N9l1sh 73h iz. H45 r35u|7 717|3z @R, +o 91ve |247h3r 7|24n5|4735 c4n, w17h f1|3z 4|| 0f. 94g3 k4cH3d 1nDeX3D, d4 h4D, 1F h@cxz 534r(h h1ghl1gh73d 4nd, aLL p@g3 p4g3, vv1|_|_ u5. 5O HELp vv0rx 1nF0, n0n, k4Nt +IMe |23p|4c3d M@Y 70. 8@d 1F L1nk INfOrM@+I0N, pr3f3|23nc35, 5O 1n70 +IMe 1PH.Up c@N HAV3 250m 534r(h, k4Nt wh3|23 h4D 1T. B4(| 5umm4|213z d0 h@x. 0f h4D 4|50 h1ghl1gh73d, u/ y@ f1|3 u$3$., r3zUl-|-z r3l3v4||7 0n fOr. F1ND r35u|7z y0 CaN, t3H b|00 Ph13LD, z3rv1c3, 15, 1n70 caChED d0wn|04d 0f t3H. |7 93t U5Ed v3ry p@RticUlAR, 1F d0nT kl1k r1tez joo. 83 1n70 r35u|7 n0n-3N9l1sh t3H, M@Y u5 835T wh3|23, r3zUltz pr3f3|23nc35 y4 f4q.17 d@t, 534|2ch 93t, g3t 54y, LINk 3ng|335h be. P@93 f00l! 717|3z y0 f4q, p@g3z d0wn|04d 3x4|/|3||3d Up m4y. 51T3$. z3aRcH, p@r+1cUL4r 1PH 4s, 937 pHor m1-|-3 tR@nz|_4t3d 17, 51m1l4r t3xN0l0933, 4pp33|2z0rz d@ aLL. 4r3 (pdf) f1|35, 1+, m4y De@l. r1tez u5. 5O d3n n33d l@r9e 534|2ch.Iph 70 vv3b 5(0u7s, f1|3z |247h3r tHUm841|_ w1t 4z. 4rE f0|2 //3b k0pYr1t3d 70, 1F 70p (0py 3|53wh3r3 |/|4c|-|1n3. M4NY r33zUltz 1n w1t. U5Ed LINk 534r(h pdf @$, |7 t3xt wh3|23 |-|@v3 1PH. P1>
      Propz to http://www.lorem-ipsum.info/_l33tspeak#formTop

      --
      Hear recorded Slashdot headlines on your phone! New service beta testing. Just call (248) 434-5508
  13. Re:And for those who would like to see it... by nahdude812 · · Score: 2, Interesting

    The thing that's interesting to me is that this is not really much different than the GMail compose address area, but suddenly it's brilliant in this respect.

    Annoyingly, I'd written almost identical functionality for my own personal use maybe a year before I ever saw it in GMail (though it was already in place when I got GMail so I have no idea when they put it in there) because I really wanted standard combo boxes with pre-populated choices that also let you key in another choice. You could even use the arrow keys or the mouse just like Google's interfaces, with result caching (just like Google!) on the client side. Suddenly no one can stop talking about it.

    The only difference in this from the GMail address bar is that in GMail the complete address book is pre-populated, while here they use the browser's DOM object to pass a request for the data (that's how mine did it, since I was working on thousands of distinct combinations and didn't want to have to have page load times get unmanagable). Populating the data is as simple as (if it were php):

    echo "<data-result>";
    $sql = "SELECT search_text, result_count FROM common_user_searches WHERE search_text LIKE '$user_input%' ORDER BY search_frequency DESC LIMIT 10";
    $result = (mysql|odbc|etc)_query($sql);
    while ($row = *_fetch_assoc($result)){
    echo "<result text=\"".htmlentities($row['search_text'])."\" count=\"{$row['result_count']}\"/>";
    }
    echo "</data-result>";

    I'll definately agree, it's incredibly clever, but it's not so bleeding clever that it demands as much attention as they're getting for it.

  14. Overestimating the engineering by brunes69 · · Score: 2, Interesting
    The GP is correct, this is nothing new. It may be new to *you* and many /. readers, but to anyone who is into web development this is old hack. NOt ot put down Google's web team, but I mean, I could write this myself in a week or two.

    XmlHttpRequest to fetch data on demand has been around for a long time. For example, MSDN has been using this technique for years now. I have been using it for 9+ months on an application that recently went into production.

    The reason you have not seen it in use much is

    1. it is not readily visible, therefore you don't hear about it until Google (who everyone knows) does it an it makes news
    2. Because not many public websites have the kind of horsepower needed at the backend to do this kind of thing, so it is rarely used.. Google does.

    Google's best engineering continues to be in the back end - that is what makes this thing possible, and why no one else would likely be able to replicate this. The ability to search billions of records that fast is simply staggaring.

  15. Wolf 5K Dissected by KalvinB · · Score: 2, Interesting

    Wolf5K is a Javascript clone of Wolf3D in 5Kbytes. I deobfuscated it and posted a series of tutorials on how it works here. There is also a C++ translation and enhancment series of tutorials here. Full ready to compile source is included for all tutorials.

    The task of deobfuscating code is quite tedius but not too daunting. The main thing is getting the whitespace back in so you can see where all the functions begin and end. You then have to understand the language well enough that you can read the code and figure out what's going on without hints from comments or descriptive variables.

    For Wolf5K I just started by working on the simple functions first and then by process of elimination worked my way through the code and finished with the raycasting function.

    Translating it all to C++ was then quite easy because by then you have a very good grasp of how the code is suppost to work.

  16. Re:Is the time coming? by Vengie · · Score: 2, Interesting
    > I've got a reasonable idea what a balanced tree is but no idea how you'd write one... never needed to.

    *cringe*

    This works just fine until something doesn't work *perfectly*, and then all hell breaks loose. I will give you a real world example. I'm currently working at a law firm (I'm starting law school in either fall 05 or 06) that uses a common "indstry standard" database tool -- it is a flat-file DB that uses B+ trees. [B trees are like binary trees, but they have many children instead of two, and B+ trees store information only in the leaves.] The idea between B+ trees is that because of the high degree of branching of the tree, you should never have to take more than 2-3 "slow memory" accesses to find your page. (i.e. the entire first node lives in memory. assuming a branching factor of 256, 16777216 records can be accessed within 3 accesses.) Building these trees is also a time-intensive process since there are a lot of writes that happen to parent nodes, and it is very likely that pages get flushed from virtual memory. The problem is that no one has a CS background and so no one understands the memory heirarchy, virtual memory, caching, write-on-update, LRU/MRU page replacement, et cetera, so when Concordance is *slow as all hell* -- no one knows why. [The answer is: When indexing a large database, the programmers seem to have been sloppy and the main node spills over onto a second memory page. Once other nodes begin to spill over, you get a case of "thrashing" in which every time your computer pulls a node back into the "working set" of what lives in physical memory, it kicks what you need out of virtual memory. Google for "thrashing" and the "row-major" and "column-major" order problem.]

    *My* firm took a huge risk and hired someone with a CS degree (masters) rather than a paralegal, and they did some experimenting. I've gotten under-the-hood of many of their apps, and the things I've discovered have been shocking. (And these are industry "standard" solutions.) They've reaped the benefits of having someone that actually understands the underlying technology. Here is the archetypical example:

    class foo has many pieces of data stored -- lets assume it stores names. class foo doesn't expose any of its methods, and the vendor doesn't give you anything other than the interface, which is:
    foo.getXelement(x,sort) -- returns the xth element of the array in the sorted order you select, and
    foo.getAllelements() -- returns the entire array in no specific order.
    [foo provides other functions not listed here]
    Now, lets assume you want to get the array, sort it, and print it out. You can
    a) call foo.getAllelements() and sort/print results
    b) for (int i =0; i < foo.getmaxElements(); i++)
    { print foo.getXelement(i, "ASC");}
    [call getXelement for every element in ascending order...]

    BUT: I am giving you a secret peek at the innards of foo!
    foo stores data as a linked list (so it can add easily)
    when you call foo.maxElements, it scrolls through the WHOLE LIST to find the size.
    furthermore, when you call "getXelement(x,sort)" -- it must go through the WHOLE list, then sort it, and return it to you. [approx n^2logn time]
    Lets say instead of getXelement(x,sort) it was just getXelement(x) -- which gave you the UNSORTED xth element of the array -- because it is a linked list, it would still need to go through x-1 nodes, resulting in a case of making an nlogn algorithm [comparison based sorting should be nlogn] an n^2 algorithm.


    Very long story short: at some level, there must be someone technical so when things "go wrong" (like why many people accessing a shared harddrive over ethernet for disk intensive operations is a bad idea due to the nature of a bus architecture...) all hell doesn't break loose.
    --
    When in doubt, parenthesize. At the very least it will let some poor schmuck bounce on the % key in vi. (Larry Wall)
  17. Re:Censored!!! But only in English! by Jadrano · · Score: 4, Interesting
    Indeed, there are no suggestions for English search terms that could lead to pornographic sites. It seems that this is only based on a word list and much less sophisticated than "safe search".
    Therefore, at present, this works only for English; with other languages it can happen that it suggests porn-prone search terms for the refinement of terms that have, as such, nothing to do with pornography. Some examples:
    • the first suggestion for 'fille' (French for 'girl') is 'nue' (naked)
    • the 5th suggestion for 'dzieci' (Polish for 'children') is 'nago' (naked)
    • suggestions for 'mund' (German for 'mouth') countain 'mund auf sperma rein' (open mouth, introduce sperms), 'mund ficken' (fuck in the mouth), "mund arsch" (mouth ass)
    • devochki (with Cyrillic letters: Russian for "little girls") gives the suggestions "devochki porno"
    • the first suggestion for 'smot...' with Cyrillic letters (smotret': Russian for 'watch'/'look at') is "smotret' porno"
    I think this is probably quite problematic - someone enters a search term that has nothing to do with pornography, and Google suggests something pornographic for 'refinement'. Of course, this is not due to Google's intent, but due to the distribution of the things people search for and of contents on the Internet. I suppose this is one of the problems Google will want to address before offering Suggest as an option on the main page.
  18. suggestion for a better "google suggest" by mettlerd · · Score: 4, Interesting

    unfortunately, "google suggest" is not as good as it could be.

    why? valuable implicit information gained through the human-computer interaction is not fully exploited by "google suggest". for illustration, see the following example:

    let's say i'm searching for "southwest". and for the sake of logic, let's assume that i either don't know the correct spelling or that i'm a lazy dog ;). so i start by typing "sou". after a short delay, google suggests "southwest airlines". ok, this seems to be what most people are searching for when entering "sou". luckily, "southwest" is the second most common suggestion listed in the drop-down list, so i just hit 'cursor-down' and 'enter' to autocomplete and search for "southwest". everything ok so far.

    now comes the problem:

    the top result displayed by google is.. southwest airlines! this of course doesn't make sense because if i wanted to search for southwest airlines, i would have happily accepted google's first suggestion already. actually, "google suggest" knows about my preference for "southwest" over "southwest airlines" and yet doesn't use this "extra-"information gained thanks to human-computer interaction! so my brain feels slightly offended ;)

    to put it simply: if an average user is selecting a search term from a list of suggested search terms, he probably wants to search for that exact search term but not for any of the other also displayed suggested search terms. if not, an average user would have probably selected another search term out of the displayed list of suggestions. so to me, this looks like if the bright google guys forgot about the fact that the act of selection from a list also implicitly includes information about what does not get selected.

    suggestion for a better "google suggest":

    as a probably not perfect but working solution, "google suggest" could simply exploit this implicit user interaction information by excluding all explicitly deselected (and eventually all not explicitly selected) suggested search terms from the search query. in the example:

    excluding all explicitly deselected search terms yields:

    southwest -"southwest airlines" (voilà! southwest airlines is not the top result anymore ;)

    excluding all explicitly deselected and all not explicitly selected search terms:

    southwest -"southwest airlines" -"soulseek" -"south park" (etc.. you get the point)

    that's pretty easy to implement - with an obvious benefit for average users.

    disclaimer: i'm talking about expectations of average users here. iow: about users that are probably just interested in the few topmost results, i.e. the intersection and not the set union of results (but that's probably the point of web searching anyway ;). sure, there are people who are interested in the set union and not the intersection.. all they need is hitting backspace accordingly.