The search control displays the query results for the different searchers
added to a search control object in one of the two draw modes: linear
or tabbed. The linear draw mode is the default and is shown in Fig.
10.3.
Fig. 10.3 Linear Draw Mode
The tabbed draw mode is shown in Fig. 10.4.
10.4 Creating a Google Ajax Web Search Application 199
Fig. 10.4 Tabbed Draw Mode
The search results may be displayed in one of the three expansion
modes: open, closed, or partial. In the open expansion mode the
search results are displayed fully. In the closed mode the search results
are not displayed until a UI element such as an arrow is clicked. The
partial search result displays partial results. The default expansion
mode is partial.
10.4 Creating a Google Ajax Web Search Application
In this section we shall create a Google Ajax Search application using the
Google Local search service. To the ajaxsearch.jsp add the Google Ajax
Search API JavaScript library. Specify the Google Ajax Search API key in
the src attribute for the script tag.
Create a JavaScript function, onLoad(), to add a search control and
search service. In the onLoad() function create a search control object.
var searchControl = new GSearchControl();
Set the result set size to GSearch.
Pages:
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180