Update to Google v4
Overview
There are critical updates to Google search forms that need to be applied before October 26, 2006.
This page provides instructions for MIT web publishers to upgrade an existing search form to Google v4 compatibility. Please read the section that best applies to your web form:
- All search forms need these two changes
- Forms that use a subcollection
- Changes to the Custom Results Stylesheet
We strongly suggest that you upgrade the search form on your web site as soon as possible.
All search forms
All existing forms will need these two changes to be compatible with Google v.4.
- Change the form action target from:
<form method='get'
action='http://gb-server.mit.edu/search'> |
to:
<form method='get' action='http://search.mit.edu/search'
> |
- Change the proxystylesheet parameter from:
<input type='hidden' name='proxystylesheet' value='http://web.mit.edu/xsl/google-mit.xsl'/> |
to:
<input type='hidden'
name='proxystylesheet' value='mit'/> |
Note: If you created a custom results
stylesheet, skip this step and see below.
Your form should now look similar to the following:
| <form method='get' action='http://search.mit.edu/search'>
<input type='text' name='q' size='32'
maxlength='255' value=''/>
<input type='submit' name='btnG' value='Search'/>
<input type='hidden' name='site' value='mit'/>
<input type='hidden' name='client' value='mit'/>
<input type='hidden' name='proxystylesheet'
value='mit'/>
<input type='hidden' name='output' value='xml_no_dtd'/>
<input type='hidden' name='as_dt' value='i'/>
<input type='hidden' name='as_sitesearch'
value='web.mit.edu/your_URL' />
</form> |
Add a search box to your site provides additional reference for the relevant search
parameters in the form above.
Forms that use a subcollection
If your web form uses a subcollection (now termed
collection), you will also need to make the following changes
to your search form:
- Delete the restrict parameter, which specifes the name of
your (sub)collection:
Delete: <input type='hidden' name='restrict' value='your_subcollection_name'/>
|
- Change the site parameter from:
<input type='hidden' name='site' value='mit'/>
|
to:
<input type='hidden' name='site' value='your_subcollection_name'/>
|
Forms that use a Custom Results Stylesheet
If your search form uses a custom
results stylesheet for use with MIT-Google, you may leave your
proxystylesheet parameter (which specifies the URI of your
stylesheet) in your search form unchanged.
However, you will need to update your stylesheet (XSLT file) to work
with the new Google v4 appliance. The process of updating your custom
stylesheet is technically involved—below are some general
guidelines that may help you. However, IS&T cannot provide
support for updating customized stylesheets; please contact Web Communications Services
(WCS) for fee-based consulting.
Guidelines for updating your stylesheet:
- Identify your specific modifications in your customized XSLT
stylesheet by comparing the differences between your customized
stylesheet and the default, unmodified Google v3 XSLT
stylesheet. You can use the diff utility on Athena to
help you identify your customizations.
- Apply your identified customizations to the new default Google v4
XSLT stylesheet:
- Apply modifications incrementally and test your new v4 stylesheet
after each modification. Use this form to test your
stylesheet. (Note: your stylesheet must be web-accessible for
testing.)
- If your modifications include the html_escaped_query_mit
and/or html_site_query_mit variables, you do not
need to copy those templates to your new stylesheet (the default Google v4 XSLT stylesheet already implements those templates).
- If your stylesheet generates search forms in the results page, be
sure to update the form parameters for Google v4 compatibility (as
described above). In particular, pay special attention to the
form parameters that have been updated:
Additionally, you may find it helpful to look at the reference MIT-branded
XSLT stylesheet google-mit.v4.xsl.
The mit_search_form template (within the google-mit.v4.xsl
stylesheet) provides an improved model for generating search forms
within the search results page.
List of known changes to the stylesheet
- All form tags within the v3 stylesheet must be updated to use the proper v4 server name
- All input proxystylesheet tags within the v3 stylesheet must refer to the new v4 stylesheet
- If a collection is in use, the restrict tag must be deleted and site tag repointed to the collection
- The template "html_escaped_query" is now called "space_normalized_query"
[Back to top]
|