The search services are provided by searchers, which are represented
by the GSearch class. The different searchers that are provided are
discussed in Table 10.2.
198 10 Web Search with Ajax
Table 10.2 Searchers
Searcher Description
GwebSearch Provides the Google web search service. The search may be
restricted to a specific web site, such as Expedia.com, using the
setSiteRestriction method.
GlocalSearch Provides the local search service. The location for the search
may be specified using GPoint, GMap or a string.
GvideoSearch Provides the Google Video Search service.
GblogSearch Provides the Google Blog Search Service.
GnewsSearch Provides the Google New Service.
GbookSearch Provides the Google Book Search service
Some of the methods that are common to all searchers are
setResultSetSize, clearResults, execute(query),
setSearchCompleteCallback, setUserDefinedLabel, and
setLinkTarget. The setResultSetSize method sets the number
of results returned by a searcher. The clearResults method clears the
search results and resets the searcher. The
setSearchCompleteCallback method registers a callback method
on the searcher to be invoked when the search completes. The
setUserDefinedLabel method sets a label for search result section,
which replaces the default label Local, Web, or Blog. The
setLinkTarget method specifies the link target for links in the search
results. The default is to open the links a new browser window.
Pages:
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179