Office of Information Technology
WMU Home About WMU Academics Admissions Student Life Alumni and Friends
   

WMU > OIT > Help Desk > Web

Adding a Google Appliance Search to Your Site

In the spring of 2006, the Office of Information Technology purchased a Google Mini Search Appliance (GA). This search appliance, located at <http://search.wmich.edu/>, replaced the Alta Vista search formerly in use at WMU on May 01, 2006. Any Web pages that submitted search queries to search.wmich.edu prior to May 1st, should be modified to use the GA specifications.

How do we start using the GA?

The first thing you need to do to start using the GA is to add a GA Web form. Cut and paste the below code and add it to your page where you want the search box to appear.

<!-- BEGIN: simple google xhtml form -->
<form action="http://search.wmich.edu/search" method="get" name="gs">
<!-- BEGIN: search box and button -->
<input maxlength="256" name="q" size="32" type="text" />&nbsp;&nbsp;
<input name="btnG" type="submit" value="Search WMU" />
<!-- END: search box and button -->

<!-- BEGIN: hidden field params to the software -->
<input name="client" type="hidden" value="wmu" />
<input name="ie" type="hidden" value="utf8" />
<input name="oe" type="hidden" value="utf8" />
<input name="output" type="hidden" value="xml_no_dtd" />
<input name="proxystylesheet" type="hidden" value="wmu" />
<input name="site" type="hidden" value="wmu" />
<!-- END: hidden field params to the appliance -->
</form>
<!-- END: simple google xhtml form -->

How do I search just my site?

You would add one more hidden parameter to be submitted with the other form values. (This example shows a site search specific to hcob.wmich.edu and another specific to www.wmich.edu/oit)

<!-- BEGIN: site specific google xhtml form -->
<form action="http://search.wmich.edu/search" method="get" name="gs">
<!-- BEGIN: search box and button -->
<input maxlength="256" name="q" size="32" type="text" />&nbsp;&nbsp;
<input name="btnG" type="submit" value="Search WMU" />
<!-- END: search box and button -->

<!-- BEGIN: hidden field params to the software -->
<input name="client" type="hidden" value="wmu" />
<input name="ie" type="hidden" value="utf8" />
<input name="oe" type="hidden" value="utf8" />
<input name="output" type="hidden" value="xml_no_dtd" />
<input name="proxystylesheet" type="hidden" value="wmu" />
<input name="site" type="hidden" value="wmu" />

<!-- this filter defines which site to return results for -->
<input name="as_sitesearch" type="hidden" value="hcob.wmich.edu" />

<!-- another example using a departmental account on www -->
<input name="as_sitesearch" type="hidden" value="www.wmich.edu/oit" />

<!-- END: hidden field params to the appliance -->
</form>
<!-- END: site specific google xhtml form -->

Note: this requires your site actually being in the GA's index. We believe that we have located all relevant hosts directly associated with WMU, but if we missed you, send the google team an e-mail <oit-unix+google@wmich.edu> and we will try to get your host included in the scheduled crawls.

How do I exclude certain folders from the search results?

You would specify another hidden parameter in your form. This parameter can be used in conjunction with the site search paramter. For example, by default, you want to return all the matching results for anything within your site, but information on pages located in your calendar folder. You would define this exclusion in the following manner:

<!-- BEGIN: site specific google xhtml form -->
<form action="http://search.wmich.edu/search" method="get" name="gs">
<!-- BEGIN: search box and button -->
<input maxlength="256" name="q" size="32" type="text" />&nbsp;&nbsp;
<input name="btnG" type="submit" value="Search WMU" />
<!-- END: search box and button -->

<!-- BEGIN: hidden field params to the software -->
<input name="client" type="hidden" value="wmu" />
<input name="ie" type="hidden" value="utf8" />
<input name="oe" type="hidden" value="utf8" />
<input name="output" type="hidden" value="xml_no_dtd" />
<input name="proxystylesheet" type="hidden" value="wmu" />
<input name="site" type="hidden" value="wmu" />
<input name="as_sitesearch" type="hidden" value="dept.wmich.edu" />

<!-- this field can be used to create a filter that defines which
folder(s) to exclude from the search. -->
<input name="as_eq" type="hidden" value="/calendar" />

<!-- END: hidden field params to the appliance -->
</form>
<!-- END: site specific google xhtml form -->


You can specify more than one folder to exclude. you just have to remember to separate each folder you want excluded with spaces. For example, if you want to omit matching results from both the calendar and the news folders, do it like this:

<!-- this field can be used to create a filter that defines which
folder(s) to exclude from the search. -->
<input name="as_eq" type="hidden" value="/calendar /news" />

The default behavior for a folder filter defined as "calendar" or "/calendar" is to exclude that folder, it's files and all subsequent folders and their files. If you define your search filter as "calendar/" or "/calendar/", with the trailing directory boundary, the GA will index that folder and the files contained in that folder, but will ignore all subsequent folders and the files contained within them.

 

 

 
Office of Information Technology, Western Michigan University, Kalamazoo, Michigan, 49008-5206
Phone (269) 387-5430 |
Contact OIT | Last Updated: March 4, 2008
Report Copyright Infringements
Western Michigan University Student Information System Western Michigan University