Creating a Search Form


It's easy to setup search on a single department Web site. Just use one of the HTML code examples below to place a search box form onto an Official Cal Poly Web page..

CP Search is powered by the Google Search Appliance. Google has developed a simple HTTP-based protocol (web based) for serving search results to our search partners (that's you!). Search administrators can have complete control over how search results are requested and presented to the end user. See the custom search results section below if you're interested in creating a custom search experience for your users.

How the search box works

A Google search request is a simple Web form submission (an HTTP request) to the Google search appliance. The search request format and options that are available for use are detailed in the Search Protocol Reference on the Google Web site.

The search results are returned in the output format specified in the search request. Currently, Google supports output results in XML and HTML format. XML formatted results give you the power to customize the display of the results any way you see fit through the implementation of a custom XML parser. The HTML results can be customized through the application of an XSL style sheet to the standard XML results. For a more technical discussion see the Request Format section of the Google Search Protocol Reference provided on the Google website.

Back to Top

Use this single department search method to search across only one Web site.

The example below is a search input box that searches across only one Web site (e.g. servicedesk.calpoly.edu). This method can be used instead to search within a folder of a Web site. The results use the standard Cal Poly look-and-feel...


To install this type of search on your web site:

  1. Cut and Paste the following code into your HTML document
  2. Replace the "sitesearch" name value with your Web address (only one Web address can be included in single search using the sitesearch query tag). E.g. replace servicedesk.calpoly.edu with your web site address. Oh, yes, change the text that reads "Search the Service Desk Web site"

<form action="http://search.calstate.edu/search" method="get" id="g_s" title="Search Form">
<div><label for="g_search">Search the Service Desk Web site</label><br />
<input type="text" name="q" id="g_search" title="Search Text" accesskey="s" alt="Search Text" size="32" maxlength="256" value="" />
<input type="submit" name="btnG" value="Search" />
<input type="hidden" name="site" value="slo-CalPoly" />
<input type="hidden" name="client" value="slo-CalPoly" />
<input type="hidden" name="proxystylesheet" value="slo-CalPoly" />
<input type="hidden" name="sitesearch" value="servicedesk.calpoly.edu" />
<input type="hidden" name="output" value="xml_no_dtd" /></div>
</form>

Important notes for the Single Department web site search method

This method restricts a search to a specific Web site using the "sitesearch" parameter tag. Again, only ONE Web server can be included in the single site search using the sitesearch tag.

Searches can be restricted to either the root level or folder level of any single Web server. Here's some examples on how to do this:

  • <input type="hidden" name="sitesearch" value="asi.calpoly.edu"> limits the search to pages on the main ASI Web site.
  • <input type="hidden" name="sitesearch" value="www.calpolyarts.org"> limits the search to pages on the main Cal Poly Arts Web site (see the list of included domain names to see if your web site address is included in the search engine).
  • <input type="hidden" name="sitesearch" value="www.afd.calpoly.edu/police"> limits the search to pages in the "police" folder of the AFD Web server including sub-folders of /police.
    Note: the trailing slash of the URL is omitted in order to include everything under the /police folder.
  • <input type="hidden" name="sitesearch" value="www.afd.calpoly.edu/police/"> (note the trailing slash) limits the search only to pages within the /police/ folder regardless of the existence of sub-folders within /police/.
    Note: If a trailing slash ( / ) is used at the end of a URL, the search engine will execute a search on only those files indicated by the folder at the end of the URL string.
  • <input type="hidden" name="sitesearch" value="www.calpoly.edu/~jdoe"> limits the search to pages on the "jdoe" user account on the Central UNIX Web server (note: the trailing slash of the URL is omitted).

Back to Top

Search all Cal Poly web sites

This box searches across all Cal Poly Web sites. To place a CP Search input box on your Web page that looks like the one below (without the surrounding border)...


Search across Cal Poly Web sites

Cut and paste the following HTML code into your Web page:

<form action="http://search.calstate.edu/search" method="get" id="googlesearch" title="Search Form">
<div><label for="gsearch">Search across Cal Poly Web sites</label><br />
<input type="text" name="q" id="gsearch" accesskey="s" title="Search Text" alt="Search Text" size="32" maxlength="256" value="" />
<input type="submit" name="btnG" value="Search" />
<input type="hidden" name="site" value="slo-CalPoly" />
<input type="hidden" name="client" value="slo-CalPoly" />
<input type="hidden" name="proxystylesheet" value="slo-CalPoly" />
<input type="hidden" name="output" value="xml_no_dtd" /></div>
</form>

Back to Top

You can take full advantage of the Google Search Appliance by obtaining an account on the search appliance and managing a collection of sites that you'd like to be searched. This will help your visitors find content within your various site pages. This method restricts the search to a collection of sites (or a specific site) instead of searching the entire Cal Poly site.

  • This option requires the use of a management account on the Google search appliance to customize a collection of Web site URL's and to customize the search results look-and-feel using a front-end.
  • To take advantage of this option, please contact the ITS Service Desk at 756-7000 to request assistance with a Google search appliance account.

The following example demonstrates the custom search idea by searching across multiple ITS web sites (notice the search results are from multiple ITS sites).


Sample Form - Search all ITS web sites using the Google Search Appliance

Why would I need custom search results?

  • This option is for you if you need a search experience that encompasses several web sites (a collection), need reports/statistics on search queries, need a customized look-and-feel (search results page), and/or need the ability to tailor KeyMatches and Synonyms.
  • This option provides you with an account on the search appliance (a search engine manager account), a collection, and a front-end for configuring and managing the search results look-and-feel for your web site.
  • This is a self-service model and in order to use this option, a Cal Poly staff or faculty member will be assigned the manager account on the Google search appliance. This individual will be responsible for maintaining the assigned collection and front-end on the search appliance. Student accounts are granted only in special circumstances.

Note: As a self service model, ITS provides minimal support for this option. In particular, ITS does not provide support for developing the XSLT style sheet that is required for the front-end. A default XSLT style sheet is provided. Assistance with formatting the search results can be found in the Results Format section of the Google Search Protocol Reference provided on the Google website.

Additional information on how to configure a search box on your Web site using this option can be found in the Customizing Your Search Results section.