ajax Google 即搜即得如何工作?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3670831/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How does Google Instant work?
提问by DexterW
Any ideas on exactly how the new google instant search works? It seems to just be AJAX calls to the old search, but it's pretty hard to simplify Google that much. Anybody have speculations?
关于新的谷歌即时搜索的工作原理有什么想法吗?这似乎只是对旧搜索的 AJAX 调用,但要简化 Google 非常困难。有人有猜测吗?
EDIT: I know there is AJAX sent with each keypress, but is it predictive? Or do you think it's just a regular ol' google search?
编辑:我知道每次按键都会发送 AJAX,但它是预测性的吗?或者你认为这只是一个普通的谷歌搜索?
回答by Daniel Vassallo
UPDATE:Google have just published a blog article called Google Instant, behind the scenes. It's an interesting read, and obviously related to this question. You can read how they tackled the extra load (5-7X according to the article) on the server-side, for example. The answer below examines what happens on the client-side:
更新:谷歌刚刚在幕后发布了一篇名为Google Instant的博客文章。这是一个有趣的阅读,显然与这个问题有关。例如,您可以阅读他们如何处理服务器端的额外负载(根据文章为 5-7X)。下面的答案检查了客户端发生的情况:
Examining with Firebug, Google is doing an AjaxGET request on every keypress:
使用Firebug检查,Google 正在对每个按键执行AjaxGET 请求:


I guess it's working the same way as the auto completion. However this time, it also returns the search results of the partially complete search phrase in JSONformat.
我想它的工作方式与自动完成相同。但是这一次,它也以JSON格式返回了部分完整搜索词组的搜索结果。
Examining one of the JSON responses while typing "Stack Overflow":
在键入“Stack Overflow”时检查 JSON 响应之一:


We can see that the JSON response contains the content to construct the search results as we type.
我们可以看到 JSON 响应包含在我们键入时构建搜索结果的内容。
The formatted JSON responses look something like this:
格式化的 JSON 响应如下所示:
{
e: "j9iHTLXlLNmXOJLQ3cMO",
c: 1,
u: "http://www.google.com/search?hl\x3den\x26expIds\x3d17259,24472,24923,25260,25901,25907,26095,26446,26530\x26sugexp\x3dldymls\x26xhr\x3dt\x26q\x3dStack%20Overflow\x26cp\x3d6\x26pf\x3dp\x26sclient\x3dpsy\x26aq\x3df\x26aqi\x3dg4g-o1\x26aql\x3d\x26oq\x3dStack+\x26gs_rfai\x3d\x26pbx\x3d1\x26fp\x3df97fdf10596ae095\x26tch\x3d1\x26ech\x3d1\x26psi\x3dj9iHTO3xBo2CONvDzaEO12839712156911",
d: "\x3clink rel\x3dprefetch href\x3d\x22http://stackoverflow.com/\x22\x3e\x3cscript\x3eje.pa(_loc, \x27rso\x27, \x27\x3c!--m--\x3e\x3clink rel\x3dprefetch href\x3d\x22http://stackoverflow.com/\x22\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://stackoverflow.com/\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNERidL9Hb6OvGW93_Y6MRj3aTdMVA\x27,\x27\x27,\x270CBYQFjAA\x27)\x22\x3e\x3cem\x3eStack Overflow\x3c/em\x3e\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3eA language-independent collaboratively edited question and answer site for programmers.\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3e\x3cb\x3estackoverflow\x3c/b\x3e.com/\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:U1GC2GYOToIJ:stackoverflow.com/+Stack+Overflow\x26amp;cd\x3d1\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNFfKMag7Tq8CMbbfu8Gcj_GjukTbA\x27,\x27\x27,\x270CBgQIDAA\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:stackoverflow.com/+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CBkQHzAA\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3cbr\x3e\x3ctable class\x3dslk style\x3d\x22border-collapse:collapse;margin-top:4px\x22\x3e\x3ctr\x3e\x3ctd style\x3d\x22padding-left:14px;vertical-align:top\x22\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://stackoverflow.com/questions\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNHmP78gEctJKvBrydP2c52F_FEjvA\x27,\x27\x27,\x270CBoQqwMoADAA\x27)\x22\x3eQuestions\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://stackoverflow.com/questions/ask\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNGZF-qwWVTZOWPlr4vgSA7qB64LLQ\x27,\x27\x27,\x270CBsQqwMoATAA\x27)\x22\x3eAsk Question\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://stackoverflow.com/users/135152/omg-ponies\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNE9zo6Qi_AM1bjmPGeMGfbnPi3niA\x27,\x27\x27,\x270CBwQqwMoAjAA\x27)\x22\x3eOMG Ponies\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://careers.stackoverflow.com/\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNEaqlBrfDcc1gdPZ6dgthff0s5WmA\x27,\x27\x27,\x270CB0QqwMoAzAA\x27)\x22\x3eCareers\x3c/a\x3e\x3c/div\x3e\x3ctd style\x3d\x22padding-left:14px;vertical-align:top\x22\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://stackoverflow.com/about\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNEqgPttrXj3r4o3TZHX5WaWvFe1HQ\x27,\x27\x27,\x270CB4QqwMoBDAA\x27)\x22\x3eAbout\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://stackoverflow.com/faq\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNF3X3eRc0RsxYynXZhhbyYkuKWZ5g\x27,\x27\x27,\x270CB8QqwMoBTAA\x27)\x22\x3eThe FAQ\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://blog.stackoverflow.com/\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNG7KphjK6RuC5cj-6U5jeuvipt5dg\x27,\x27\x27,\x270CCAQqwMoBjAA\x27)\x22\x3eBlog\x3c/a\x3e\x3c/div\x3e\x3cdiv class\x3dsld\x3e\x3ca class\x3dsla href\x3d\x22http://stackoverflow.com/users\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x271\x27,\x27AFQjCNFfN_wcGm4HE5XpDxvcH4bIrkv2dw\x27,\x27\x27,\x270CCEQqwMoBzAA\x27)\x22\x3eUsers\x3c/a\x3e\x3c/div\x3e\x3ctr\x3e\x3ctd colspan\x3d2 style\x3d\x22padding-left:14px;vertical-align:top\x22\x3e\x3cdiv style\x3d\x22padding-top:6px\x22\x3e\x3ca class\x3dfl href\x3d\x22/search?hl\x3den\x26amp;q\x3d+site:stackoverflow.com+Stack+Overflow\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CCIQrAM\x22\x3eMore results from stackoverflow.com\x26nbsp;\x26raquo;\x3c/a\x3e\x3c/div\x3e\x3c/table\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://stackoverflow.com/questions\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x272\x27,\x27AFQjCNHmP78gEctJKvBrydP2c52F_FEjvA\x27,\x27\x27,\x270CCUQFjAB\x27)\x22\x3eHottest Questions - \x3cem\x3eStack Overflow\x3c/em\x3e\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3eHello \x3cem\x3eStack Overflow\x3c/em\x3e! I\x26#39;m working with someone else\x26#39;s PHP function that works fine as long as I pass it at least three arguments. If I pass it two argument, \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3e\x3cb\x3estackoverflow\x3c/b\x3e.com/questions\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:6S_0sErDKfQJ:stackoverflow.com/questions+Stack+Overflow\x26amp;cd\x3d2\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x272\x27,\x27AFQjCNH7WHzefYlnS05ln4j6rzfE3byDKg\x27,\x27\x27,\x270CCcQIDAB\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:stackoverflow.com/questions+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CCgQHzAB\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://en.wikipedia.org/wiki/Stack_overflow\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x273\x27,\x27AFQjCNEAxaeWmWtD7cBcmZ5QBMsTRNbnCw\x27,\x27\x27,\x270CCkQFjAC\x27)\x22\x3e\x3cem\x3eStack overflow\x3c/em\x3e - Wikipedia, the free encyclopedia\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3eIn software, a \x3cem\x3estack overflow\x3c/em\x3e occurs when too much memory is used on the call stack. The call stack contains a limited amount of memory, often determined at \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3een.wikipedia.org/wiki/\x3cb\x3eStack\x3c/b\x3e_\x3cb\x3eoverflow\x3c/b\x3e\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:mWu8b0BQAmwJ:en.wikipedia.org/wiki/Stack_overflow+Stack+Overflow\x26amp;cd\x3d3\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x273\x27,\x27AFQjCNFG_5ndK-KmWJy6s3pOsi8lsxqEZg\x27,\x27\x27,\x270CCsQIDAC\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:en.wikipedia.org/wiki/Stack_overflow+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CCwQHzAC\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://blog.stackoverflow.com/\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x274\x27,\x27AFQjCNG7KphjK6RuC5cj-6U5jeuvipt5dg\x27,\x27\x27,\x270CC0QFjAD\x27)\x22\x3eBlog – \x3cem\x3eStack Overflow\x3c/em\x3e\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3e6 Sep 2010 \x3cb\x3e...\x3c/b\x3e The latest version of the \x3cem\x3eStack Overflow\x3c/em\x3e Trilogy Creative Commons Data Dump is now available. This reflects all public data in … \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3eblog.\x3cb\x3estackoverflow\x3c/b\x3e.com/\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:iqtvg9Ge1c0J:blog.stackoverflow.com/+Stack+Overflow\x26amp;cd\x3d4\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x274\x27,\x27AFQjCNFX2P2-RTCs_GaR6NgSw30p007UEA\x27,\x27\x27,\x270CC8QIDAD\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:blog.stackoverflow.com/+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CDAQHzAD\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x27,_ss);\x3c/script\x3e"
}/*""*/{
e: "j9iHTLXlLNmXOJLQ3cMO",
c: 1,
u: "http://www.google.com/search?hl\x3den\x26expIds\x3d17259,24472,24923,25260,25901,25907,26095,26446,26530\x26sugexp\x3dldymls\x26xhr\x3dt\x26q\x3dStack%20Overflow\x26cp\x3d6\x26pf\x3dp\x26sclient\x3dpsy\x26aq\x3df\x26aqi\x3dg4g-o1\x26aql\x3d\x26oq\x3dStack+\x26gs_rfai\x3d\x26pbx\x3d1\x26fp\x3df97fdf10596ae095\x26tch\x3d1\x26ech\x3d1\x26psi\x3dj9iHTO3xBo2CONvDzaEO12839712156911",
d: "\x3cscript\x3eje.pa(_loc, \x27rso\x27, \x27\x3c!--m--\x3e\x3cli class\x3dg style\x3d\x22margin-left:16px\x22\x3e\x3ch3 class\x3d\x22r hcw\x22\x3e\x3ca href\x3d\x22http://blog.stackoverflow.com/category/podcasts/\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x275\x27,\x27AFQjCNGnAJSxUa4GLcg-E7PNvIFmPC53gQ\x27,\x27\x27,\x270CDEQFjAE\x27)\x22\x3epodcasts - Blog – \x3cem\x3eStack Overflow\x3c/em\x3e\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s hc\x22\x3eJoel and Jeff sit down with our new community coordinator, Robert Cartaino, to record a “bonus” podcast discussing the future of \x3cem\x3eStack Overflow\x3c/em\x3e and Stack \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3eblog.\x3cb\x3estackoverflow\x3c/b\x3e.com/category/podcasts/\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:JT0sWmmtiAEJ:blog.stackoverflow.com/category/podcasts/+Stack+Overflow\x26amp;cd\x3d5\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x275\x27,\x27AFQjCNErCiLBch55HA8i5BAdChcmQYH8nw\x27,\x27\x27,\x270CDMQIDAE\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:blog.stackoverflow.com/category/podcasts/+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CDQQHzAE\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://itc.conversationsnetwork.org/series/stackoverflow.html\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x276\x27,\x27AFQjCNHG9l1PMbilYkhohNFuj3g6ce1LuA\x27,\x27\x27,\x270CDUQFjAF\x27)\x22\x3e\x3cem\x3eStackOverflow\x3c/em\x3e\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3eJoel and Jeff sit down with our new community coordinator, Robert Cartaino, to discuss the future of \x3cem\x3eStack Overflow\x3c/em\x3e and Stack Exchange 2.0. \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3eitc.conversationsnetwork.org/series/\x3cb\x3estackoverflow\x3c/b\x3e.html\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:8MkFpx7D4wYJ:itc.conversationsnetwork.org/series/stackoverflow.html+Stack+Overflow\x26amp;cd\x3d6\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x276\x27,\x27AFQjCNFP62Bg_o2kaz3jzXxzsrTs_7RdNA\x27,\x27\x27,\x270CDcQIDAF\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:itc.conversationsnetwork.org/series/stackoverflow.html+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CDgQHzAF\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://support.microsoft.com/kb/145799\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x277\x27,\x27AFQjCNHzyj5rHEX7IiyFWnP0ziE3B32rGg\x27,\x27\x27,\x270CDkQFjAG\x27)\x22\x3eHow to Troubleshoot Windows Internal \x3cem\x3eStack Overflow\x3c/em\x3e Error Messages\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3eThis article lists steps to help you troubleshoot problems with \x3cem\x3estack overflow\x3c/em\x3e errors in Windows. Stacks are reserved memory that programs use to process \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3esupport.microsoft.com/kb/145799\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:ECO9ORCsraAJ:support.microsoft.com/kb/145799+Stack+Overflow\x26amp;cd\x3d7\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x277\x27,\x27AFQjCNHYsox9EW1Ye9Nn2G6WQzEpJDOzcw\x27,\x27\x27,\x270CDsQIDAG\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:support.microsoft.com/kb/145799+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CDwQHzAG\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://stackoverflow.carsonified.com/\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x278\x27,\x27AFQjCNHcEPoch5soLj2CpLpRfnW-Z2-aLw\x27,\x27\x27,\x270CD0QFjAH\x27)\x22\x3e\x3cem\x3eStackOverflow\x3c/em\x3e DevDays ? Home\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3e\x3cem\x3eStackOverflow\x3c/em\x3e Dev Days is run by Carsonified, so please give us a shout if you need anything or are interested in sponsoring the event. \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3e\x3cb\x3estackoverflow\x3c/b\x3e.carsonified.com/\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:uhl8NPgikN0J:stackoverflow.carsonified.com/+Stack+Overflow\x26amp;cd\x3d8\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x278\x27,\x27AFQjCNFf9Vl5L3FaQGPapUpIFw5gqVUCnA\x27,\x27\x27,\x270CD8QIDAH\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:stackoverflow.carsonified.com/+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CEAQHzAH\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://stackoverflow.org/\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x279\x27,\x27AFQjCNF-YrPvTLTJlFFDJrJE0cjGdlOpbg\x27,\x27\x27,\x270CEEQFjAI\x27)\x22\x3e\x3cem\x3eStackOverflow\x3c/em\x3e.org\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3e\x3cem\x3eStackOverflow\x3c/em\x3e.org began as the merging of two ideas that have been kicking around in my head for years. First, I wanted a dorky programming-related domain \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3e\x3cb\x3estackoverflow\x3c/b\x3e.org/\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:u0dIlJW-XMYJ:stackoverflow.org/+Stack+Overflow\x26amp;cd\x3d9\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x279\x27,\x27AFQjCNHcJcV2QVybr6voztyPwHCrNOOD1w\x27,\x27\x27,\x270CEMQIDAI\x27)\x22\x3eCached\x3c/a\x3e - \x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3drelated:stackoverflow.org/+Stack+Overflow\x26amp;tbo\x3d1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CEQQHzAI\x22\x3eSimilar\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x3c!--m--\x3e\x3cli class\x3dg\x3e\x3ch3 class\x3d\x22r\x22\x3e\x3ca href\x3d\x22http://embeddedgurus.com/stack-overflow/\x22 class\x3dl onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x2710\x27,\x27AFQjCNFYQ5E8irNUCpRsbOHHyfc0oqGpWw\x27,\x27\x27,\x270CEUQFjAJ\x27)\x22\x3e\x3cem\x3eStack Overflow\x3c/em\x3e\x3c/a\x3e\x3c/h3\x3e\x3cdiv class\x3d\x22s\x22\x3e\x3cem\x3eStack Overflow\x3c/em\x3e. Nigel Jones. Nigel Jones has over 20 years of experience designing electronic circuits and firmware. (full bio). Pages. Contact Nigel. Links \x3cb\x3e...\x3c/b\x3e\x3cbr\x3e\x3cspan class\x3df\x3e\x3ccite\x3eembeddedgurus.com/\x3cb\x3estack\x3c/b\x3e-\x3cb\x3eoverflow\x3c/b\x3e/\x3c/cite\x3e - \x3cspan class\x3dgl\x3e\x3ca href\x3d\x22http://webcache.googleusercontent.com/search?q\x3dcache:Rl_rUfEG_fIJ:embeddedgurus.com/stack-overflow/+Stack+Overflow\x26amp;cd\x3d10\x26amp;hl\x3den\x26amp;ct\x3dclnk\x22 onmousedown\x3d\x22return rwt(this,\x27\x27,\x27\x27,\x27\x27,\x2710\x27,\x27AFQjCNFqMjsc1pBI9JexjMSPY7wm5QLI8w\x27,\x27\x27,\x270CEcQIDAJ\x27)\x22\x3eCached\x3c/a\x3e\x3c/span\x3e\x3c/span\x3e\x3c/div\x3e\x3c!--n--\x3e\x27,_ss);\x3c/script\x3e"
}/*""*/{
e: "j9iHTLXlLNmXOJLQ3cMO",
c: 1,
u: "http://www.google.com/search?hl\x3den\x26expIds\x3d17259,24472,24923,25260,25901,25907,26095,26446,26530\x26sugexp\x3dldymls\x26xhr\x3dt\x26q\x3dStack%20Overflow\x26cp\x3d6\x26pf\x3dp\x26sclient\x3dpsy\x26aq\x3df\x26aqi\x3dg4g-o1\x26aql\x3d\x26oq\x3dStack+\x26gs_rfai\x3d\x26pbx\x3d1\x26fp\x3df97fdf10596ae095\x26tch\x3d1\x26ech\x3d1\x26psi\x3dj9iHTO3xBo2CONvDzaEO12839712156911",
d: "\x3cscript\x3eje.p(_loc,\x27botstuff\x27,\x27 \x3cdiv id\x3dbrs style\x3d\x22clear:both;margin-bottom:17px;overflow:hidden\x22\x3e\x3cdiv class\x3d\x22med\x22 style\x3d\x22text-align:left\x22\x3eSearches related to \x3cem\x3eStack Overflow\x3c/em\x3e\x3c/div\x3e\x3cdiv class\x3dbrs_col\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dstack+overflow+error\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CEkQ1QIoAA\x22\x3estack overflow \x3cb\x3eerror\x3c/b\x3e\x3c/a\x3e\x3c/p\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dstack+overflow+internet+explorer\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CEoQ1QIoAQ\x22\x3estack overflow \x3cb\x3einternet explorer\x3c/b\x3e\x3c/a\x3e\x3c/p\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dfix+stack+overflow\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CEsQ1QIoAg\x22\x3e\x3cb\x3efix\x3c/b\x3e stack overflow\x3c/a\x3e\x3c/p\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dstack+overflow+xp\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CEwQ1QIoAw\x22\x3estack overflow \x3cb\x3exp\x3c/b\x3e\x3c/a\x3e\x3c/p\x3e\x3c/div\x3e\x3cdiv class\x3dbrs_col\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dstack+overflow+javascript\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CE0Q1QIoBA\x22\x3estack overflow \x3cb\x3ejavascript\x3c/b\x3e\x3c/a\x3e\x3c/p\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dstack+overflow+java\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CE4Q1QIoBQ\x22\x3estack overflow \x3cb\x3ejava\x3c/b\x3e\x3c/a\x3e\x3c/p\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dstack+overflow+c%2B%2B\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CE8Q1QIoBg\x22\x3estack overflow \x3cb\x3ec++\x3c/b\x3e\x3c/a\x3e\x3c/p\x3e\x3cp\x3e\x3ca href\x3d\x22/search?hl\x3den\x26amp;q\x3dstack+overflow+windows+xp\x26amp;revid\x3d-1\x26amp;sa\x3dX\x26amp;ei\x3dj9iHTLXlLNmXOJLQ3cMO\x26amp;sqi\x3d2\x26amp;ved\x3d0CFAQ1QIoBw\x22\x3estack overflow \x3cb\x3ewindows xp\x3c/b\x3e\x3c/a\x3e\x3c/p\x3e\x3c/div\x3e\x3c/div\x3e \x27,_ss);/* */\x3c/script\x3e"
}/*""*/
Further non-technical reading:
进一步的非技术阅读:
回答by David Johnstone
As others have said, Google is instantly returning the results for the top result of what Google Suggest suggests. Therefore, if you type in fac, Google Suggests thinks you are typing in facebook. Interestingly, only the partial search term, fac, is sent to Google in the JSON request, so Google Suggest is used at both ends.
正如其他人所说,Google 会立即返回 Google Suggest 建议的最高结果的结果。因此,如果您输入fac,Google Suggests 会认为您输入的是facebook。有趣的是,只有部分搜索词fac在 JSON 请求中发送给 Google,因此两端都使用了 Google Suggest。
Searches are not actually performed on everykeystroke. If you type fast enough, some can get missed.
实际上并不是每次击键都执行搜索。如果您打字速度足够快,有些可能会被漏掉。
I suspect this doesn't increase the load on Google's servers as much as you might think. Most of the additional searches are for very popular words when you start typing stuff in — if you starting searching for something beginning with f, it will search for facebook, if you start searching for something beginning with ju, it will search for justin bieber. Thanks to caching, these searches are not very expensive to do.
我怀疑这不会像您想象的那样增加 Google 服务器的负载。当您开始输入内容时,大多数附加搜索都是针对非常流行的词——如果您开始搜索以f开头的内容,它将搜索facebook,如果您开始搜索以ju开头的内容,它将搜索justin bieber。由于缓存,这些搜索不是很昂贵。
回答by Dagg Nabbit
It's predictive. The search results are from the first autocomplete suggestion (or the selected one if you hit the down arrow or mouse over a suggestion).
这是预测性的。搜索结果来自第一个自动完成建议(如果您点击向下箭头或将鼠标悬停在建议上,则为选定的)。
In other words if I type "vinyl s", the first autocomplete suggestion is "vinyl siding," and the search results clearly show a search for "vinyl siding." If I do a normal google search for "vinyl s," the search results are different.
换句话说,如果我输入“vinyl s”,第一个自动完成建议是“vinyl siding”,搜索结果会清楚地显示搜索“vinyl siding”。如果我用普通的谷歌搜索“vinyl s”,搜索结果是不同的。
So google instant is predictive in a way that normal google searches are not... it searches for the suggested autocompletion instead of the literal unfinished search query.
因此,谷歌即时搜索的预测方式与普通谷歌搜索不同……它搜索建议的自动完成功能,而不是文字未完成的搜索查询。
回答by dave1010
Converting the first value from key uin Daniel Vassallo's answer's Ajax response gives a URL, which then leads to some (invalid) JSON. I'm not sure what this bit is for yet.
从uDaniel Vassallo 的答案的 Ajax 响应中的key 转换第一个值会给出一个URL,然后会导致一些(无效的)JSON。我还不确定这个位是做什么用的。
The dgives some HTML, which gets inserted into the page. Here's a slightly decompressed version. It's mostly a script tag, which passes in 2 further chunks of HTMLto a function je.pa(). These chunks seem to be the same as the non-instant search results.
在d给出了一些HTML,它被插入到页面。这是一个稍微解压的版本。它主要是一个脚本标记,它将另外 2 个HTML 块传递给函数je.pa()。这些块似乎与非即时搜索结果相同。
回答by Fergie
I while ago I wrote a vaguely popular instant search GUI for the Solr search engine. Its really simple, so you should be able to look at the code and understand the general concepts http://fergiemcdowall.github.io/solrstrap/
不久前,我为 Solr 搜索引擎编写了一个模糊流行的即时搜索 GUI。它真的很简单,所以你应该能够查看代码并理解一般概念http://fergiemcdowall.github.io/solrstrap/

