beautypg.com

Adding an html form search box to a page – Google Search Appliance Creating the Search Experience User Manual

Page 117

background image

Google Search Appliance: Creating the Search Experience

Advanced Customization Topics

117

Capture the query terms in a text input field named q

Specify the required query parameters site, client, and output as hidden input fields

Unless you intend to retrieve raw XML results, specify proxystylesheet

In addition to the required fields, you can include any valid query parameter as a hidden input field in
the HTML form. See the Search Protocol Reference for more information on query parameters.

Search boxes should be big enough to accommodate multiple word entries. Users typically enter
queries that fit in the search box, so if the search box is small, they may enter only single words. Since
Google supports multi-word, phrase, or natural language queries, make your search box big enough for
your users to enter larger queries. The recommended minimum size for a search box is 20-30
characters.

Adding an HTML Form Search Box to a Page

To add an HTML form search box to a web page:

1.

Open the page in your preferred editor.

2.

In the section of the page where you want to display the search box, add a form tag like the
following, where appliance_hostname is the correct value for your search appliance:

3.

Inside the form tag, add a text input field named q, and provide values for size and maximum
length (the absolute search appliance limit is 2048 characters):

4.

Inside the form tag, add the required query parameters site, client, and output as hidden input
fields:



If you want to direct the search request to a non-default collection or front end, enter appropriate
values for site and client.

5.

Unless you intend to retrieve raw XML results, specify a valid value for proxystylesheet. Typically,
this value is the name of the front end you specified for client.

6.

Optionally, add a submit button field inside the form tag. If you do not add a button, end users
must use the Enter key to submit searches.

7.

Save the page.

8.

Perform a test search from the page to verify that the results page displayed as expected.

Combining an HTML Form Search Box with Inline Results

You can combine inline frame presentation of the results page with a custom search box. This
combination of factors allows users to first view the frame populated with static content, and then
replace that content with a list of search results if needed.