LARGE_RESULTSET, which
typically returns 8 results.
searchControl.setResultSetSize(GSearch.LARGE_RESULTSE
T);
Create a GlocalSearch searcher object for the Google Local search
service.
var localSearch = new GlocalSearch();
Add the searcher to the search control.
searchControl.addSearcher(localSearch);
200 10 Web Search with Ajax
Set the location for which the local search is to be performed with the
setCenterPoint(location) method.
localSearch.setCenterPoint(???Berlin Germany???);
Create a GdrawOptions object to specify the draw options for the
search results.
var drawOptions = new GdrawOptions();
Set the draw mode to linear.
drawOptions.setDrawMode(GSearchControl.DRAW_MODE_LINE
AR);
Specify a div element to display the search control results.
Loading
Activate the search control and display the results in the
searchcontrol div.
searchControl.draw(document.getElementById(???searchcon
trol???));
Register the onLoad() function with the document using the
setOnLoadCallback static method of the GSearch class. When the
document has completed loading the onLoad() function will get
invoked.
GSearch.setOnLoadCallback(OnLoad);
The ajaxsearch.jsp is listed below.
Transitional//EN???
???http://www.w3.org/TR/html4/loose.dtd???>
<%@ page contentType="text/html;charset=windows-
1252"%>
169