Skip to navigation

Google Custom Search Engine

We didn't end up using CSE but the documentation is left here just in case.

With the AJAX search alone we already can satisfy most our needs. The AJAX search can search site specific results within certain domains (ex: uwaterloo.ca, dailybulletin.uwaterloo.ca/2008) and returns up to 64 results per query.

That means the AJAX search works right out the box with all our search bars in our headers. The headers send the domain it wants to search in, all we have to do in our search engine is to attach the domain into the google query.
How can CSE help

  • The ability to rank results (by the manipulation of keywords and domains only, not specific results)
  • Predetermined keywords to narrow results
  • Site specific search for multiple domains, and rank the results according to the domain it fits in
  • Refining the user's search automatically (ex: if user searches "lecture", we can have it search for "lectures" and "lecture" automatically)
  • track search statistics from your google CSE page

How to change results in CSE

To change the results we search in this search engine, we have to develop our annotations file to host on our site, then reference the URL in the Google CSE control panel.

These files have to in a custom XML format
http://code.google.com/intl/en/apis/customsearch/docs/annotations.html#xml

To learn how to use the annotation files, you have to read the referencing sheets
http://code.google.com/apis/customsearch/docs/ranking.html#overview
http://code.google.com/apis/customsearch/docs/refinements.html#tag
http://code.google.com/apis/customsearch/docs/queries.html#synonyms

Note that for some of these refinements, such as the synonyms function, we have to put the xml code into the search engine context file, not the annotation file.
We cannot host the context file ourselves, we have to upload it to the Google CSE control panel. The context file is the file used to tell Google CSE what search engine to generate.

Context file reference
http://code.google.com/intl/en/apis/customsearch/docs/context.html

Limitations

There are certain limitations with the free google CSE:

- The number of annotations you can add: (10mb limit)
http://code.google.com/intl/en/apis/customsearch/docs/annotations.html#l...

- A Maximum of 500 synonyms per search engine

- Still limited by AJAX's 64 result limit

Integration

1) Apply cx="CSE_key_provided_by_google" into the google AJAX search query link in the enviroment.php file.

The CSE key is unique for every customized search engine you created on Google CSE.
Integrating CSE into our current search is extremely easy as we only have to change 1 line of code.

UW Website Redesign on Facebook