Google.com has begun rolling out Google Instant. This new feature not only performs a Autocomplete/Search as your type but actually performs a search based on what you have begun typing. In preliminary testing, users can save 2-5 second per search.
The feature is described in detail at http://www.google.com/instant/ It’s a significant overhaul from the current search infrastructure requiring additional capacity from Google infrastructure to support the additional queries.
Key features:
Dynamic Results – In addition to autocomplete/search as you type searches are performed and returned while you type.
Predictions – the autocomplete attempts to predict and display your full query.
Scroll to Search – You can scroll through predictions instantly with an arrow down.
“Suggest” is a new beta feature on the Google Search Appliance 6.0. Out of the box, it is designed to work with the default style sheet. However, many of our clients have chosen to use a scripted page (asp/aspx/php/jsp). In order to get this functionality working, additional coding is required. This article describes wiring up the search box via a proxy and asp.
The Service
There is a new service located at /suggest. When you type the queries are sent to it. The response comes back as a simple JSON package. It is not encoded in JSONP so if you develop a separate page and want to use it, you’re faced with a cross site scripting issue.
The Solution
Copy suggest_js.js to the site which you want to utilize the service.
Create a proxy in your server (code below)
suggest_js.js is obfuscated. But you just need to replace “/suggest” with the location of your new service (has to be at the same domain
Add the .ac-renderer, .ac-row, .ac-highlighted and .ac-active styles to your page
reference the new suggest_js.js file is reference in your html
call the function sgst(‘q’);
Start typing!
Proxy Example:
dim srcFile
srcFile = "http://gsa.mcplusa.com/suggest?"
srcFile = srcFile & "token=" & Request("token") & "&max_matches=10"</div>
'Get the JSON
Response.Buffer = True
Dim objXMLHTTP, xml
'Create an xmlhttp object
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", srcFile, False
xml.Send
Response.Write xml.responseText
set xml= Nothing