News for hackers. Stuff that matters.
Re:Google Instant, behind the scenes by mrtron on Thursday September 09, 2010 @05:25PM (#1676994)
Google Instant is shockingly fast. It is hard to imagine a small startup creating it and having it work for a few beta users. Even harder to imagine Google scaling up their infrastructure 10-fold.
Re:Google Instant, behind the scenes by moultano on Thursday September 09, 2010 @05:45PM (#1677060)
What this is really showing is how fast the underlying infrastructure already was. It had been optimized to the point that it really couldn't get any faster without speeding up the user themselves, so they did that.
Re:Google Instant, behind the scenes by loire280 on Thursday September 09, 2010 @06:05PM (#1677123)
I, for one, forget to appreciate the fact that one of the fastest web apps I regularly use is the one that searches the entire* internet.

*kinda

Re:Google Instant, behind the scenes by ugh on Thursday September 09, 2010 @07:21PM (#1677307)
I would still love to get a good layman’s explanation of how Google and other search engines can be so fast. I’m not a developer but I know a few basic concepts. Sorting makes searching fast – but that fast?

I can imagine that if I’m searching for “ball” Google already has the PageRank sorted results somewhere on its servers. That seems easy enough. But what about arbitrary search terms? Searching for “tango durlast 1978” (a soccer ball) gives me results just as fast, does Google have all of that pre-computed somewhere?

If they did that (to pick an arbitrary number) for search terms up to 100 characters (say all 26 letters, ten digits and space) that would mean that they would have to have something like 37^100=6.6e+156 pre-computed lists of results somewhere on their servers.

That can’t be what they are doing. If they were to use only one byte per possible search term (to pick another arbitrary and completely ridiculous number) they would still need to store 6.6e+144 terabyte. Which seems kinda impossible.

Re:Google Instant, behind the scenes by acqq on Thursday September 09, 2010 @07:30PM (#1677330)
1) To be able to "search (almost) the whole internet" you have to pull the content and have "almost whole internet" on your own servers.

2) You have to update your copy of the internet regularly.

3) You don't want to search all that whenever somebody types a few words. So write programs to regularly prepare indexes in advance (just like in the books) and then when the query with words comes you can "just" look up in these.

The steps above sound simple, but you can imagine that the devil is in details, that there's a lot of knowhow needed and a lot of money to do that really right. Just ask Microsoft or even some failed search company.

Re:Google Instant, behind the scenes by moultano on Thursday September 09, 2010 @07:42PM (#1677361)
There are two basic ways to build a search engine.

First think of the web as a big matrix with each row being a document and each column being a term. The first step is to decide how you want to shard this matrix across multiple machines.

You can shard by row, which lets you do really complicated scoring, but you have to hit every machine for every query.

You can shard by column, which is much cheaper, but limits how sophisticated your scoring can be.

Within each machine the problems are all probably fairly familiar.

Re:Google Instant, behind the scenes by ugh on Thursday September 09, 2010 @10:06PM (#1677639)
Doesn’t that matrix get big fairly quickly? Are there any tricks to keep it as small as possible?
Re:Google Instant, behind the scenes by jerf on Thursday September 09, 2010 @10:36PM (#1677692)
One trick I think people underestimate the effect of is that Google caches queries. When you're searching for "Madonna", you are not causing the web index to be traversed, you're retrieving the saved search for "Madonna". Google can take a couple of seconds if you throw a truly novel query at it.

Of course, storing millions of the "common queries" isn't a joke either and that still doesn't answer the question of how they search the internet within a few seconds anyhow; I'm not trying to give a complete answer, just point one aspect out. Google Instant, by design, provides the Google Suggest queries the vast bulk of the time and I guaranteed that those are either largely or possibly even entirely pre-cached, so you're not doing 10 web searches in two seconds, you're doing 10 hash lookups in 2 seconds. Which is still damned impressive, I can't hardly keep my web site loading in less than two seconds for one hit where I work.

Re:Google Instant, behind the scenes by moultano on Thursday September 09, 2010 @11:11PM (#1677759)
Major parts of that aren't true. I think something like 30% of queries have never been seen before, and Google provides low latency on those as well.
Re:Google Instant, behind the scenes by snprbob86 on Friday September 10, 2010 @03:16AM (#1678147)
Cut him some slack, it was clearly a simplification. Also, you're wrong to declare him inaccurate.

Even if 30% of queries are truly unique (a number that people have quoted from years ago, may no longer be true) caching 70% of the queries is a big win. Also, instant search is heavily relying on Google Suggest, which by it's very nature, are queries which have been performed already, so are trivially cacheable.

Re:Google Instant, behind the scenes by percept on Friday September 10, 2010 @09:48AM (#1678814)
I've always used lengthy, quoted search phrases, but what's really interesting is that Google's autocomplete has slowly trained monkey-me to follow the well-worn path and use the search terms it suggests.

It's a great example of using the UI to encourage a desired behavior.

Re:Google Instant, behind the scenes by jerf on Friday September 10, 2010 @11:15AM (#1679083)
So, let's just turn off caching and triple or quadruple the size of the Google cluster, eh? No big deal. I completely fail to see how you think that disproves my point.
Re:Google Instant, behind the scenes by moultano on Friday September 10, 2010 @11:27AM (#1679130)
I should probably mention that I work in search quality at Google. The part I took issue with is "Google can take a couple of seconds if you throw a truly novel query at it." which is definitely not true.

Google can't cache nearly as much as you would expect, not because the queries change, but because the results change.

Re:Google Instant, behind the scenes by mtklein on Friday September 10, 2010 @01:55AM (#1678022)
It gets fantastically huge when you look at quoted searches. Sure, you can build an index of key words to documents containing them, but how do you build an index for literal text searches like "to the bridge, he said"?
Re:Google Instant, behind the scenes by moultano on Thursday September 09, 2010 @11:12PM (#1677761)
Yes. It's huge.
Re:Google Instant, behind the scenes by mkelly on Friday September 10, 2010 @03:29AM (#1678174)
Some typical search engine strategies are on this page (and specifically in this subsection): https://secure.wikimedia.org/wikipedia/en/wiki/Index_%28sear...
Re:Google Instant, behind the scenes by kenjackson on Thursday September 09, 2010 @07:34PM (#1677340)
It's a combination of embarassing parallelism and clever indexing.
Re:Google Instant, behind the scenes by moultano on Thursday September 09, 2010 @07:20PM (#1677303)
The internet that Google doesn't search is almost always not the internet you want to find. :)
Re:Google Instant, behind the scenes by andreyf on Thursday September 09, 2010 @09:35PM (#1677573)
Well, it wasn't really 10-fold. Also, it didn't just mean buying more servers, as maybe most of the work was done in software: this is another feature made possible by the recent Caffeine expansion: http://mashable.com/2010/06/08/google-rolls-out-its-new-and-...
Re:Google Instant, behind the scenes by inscitekjeff on Thursday September 09, 2010 @05:55PM (#1677093)
I agree. It's an impressive interface. If this really proves to be a very desirable improvement from an end user perspective, it may take Bing YEARS to be able to duplicate the experience unless they had something like this in the works already. ie: It takes lots of coordinated effort to make something like this possible at scale. Congrats to the Google team!
Re:Google Instant, behind the scenes by kenjackson on Thursday September 09, 2010 @07:39PM (#1677353)
Technologically it's not very difficult, IMO, once you already have search engines that are as fast as Google and Bing.

The tough part for Bing, is with fewer searches, their predictive engine isn't quite as good. But this is where the Yahoo deal will pay off.

But all they need to do is fire off predictive searches and bring those back -- and of course, each predictive search only needs to bring back ten or fewer results.

Bing already does the predictive text suggestion. They just need to send back queries along with the actual text suggestion. At worst they'd need to get some more servers. But I fully expect they'd be able to roll this out in months if they wanted to.

Although personally I'd still focus on relevance. There's so much stuff both engines suck at, I'd love for them to fix some of those holes first.

Re:Google Instant, behind the scenes by edanm on Thursday September 09, 2010 @07:07PM (#1677276)
Not sure about that. Bing has far less traffic, scaling should actually be easier for them. And Microsoft certainly has resources.