Google CSE Search Interfaces

Analysis by Avi Rappoport /


There are four kinds of Google Custom Search Engine forms and results pages. They all allow users to type a search query, then send it to Google with the custom search ID. Google retrieves the matches, limited to the specified domains, sorts by relevance, and sends them back to the user's browser. There are at least four different ways to do this, and this post contains examples of most.

For more, see the Google Search Service page,
the review of the Custom Search Engine / 2007, and Google CSE AJAX Decoded

See results in a regular Google page

Opens a standard Google result page, with links only to the site(s) specified in the CSE configuration. (see Google hosted results example). This is the easiest way to go, but breaks the user's experience with the original web site.

Custom Search - hosted

See results in an iframe on a local page

When someone searches, Google uses JavaScript to fetch a specified page on the site as a results template. At the <div id="cse-search-results"></div> tag in that page, Google will insert the search results in an HTML sub-page format: iframe example. The page layout itself is flexible, but the contents in the iframe doesn't allow changes to the font or size of the text, or to set the width of the results smaller than 500 pixels.

Custom Search

Load search results on the same page (CustomSearch AJAX API)

The new Custom Search Element is particularly good for blogs and wikis, where users can't upload any pages. The CSE admin interface provides the JavaScript to call the search engine, and more JavaScript to insert the search results in the page at the location with a special tag id, for example: <div id="cse"></div>. Using CSS, many of the elements of the results section are customizable, including font, size, with of results, and display long URLs (as described in my CSE CSS page).

Note: the AJAX API will only return 8 results per page and 8 pages for a total of 64 results. Clicking on the "More results" link will display the remainder of the results on a Google-hosted results page.

Loading gcse object

for more details, see: Google CSE AJAX Decoded

XML search results (paid Site Search only)

For complete flexibility and a full results set, the Site Search XML Protocol is by far the best. It is possible to send special query parameters and get results in a granular XML structure, and format in any way desired. The XML includes the total number of matches found, advanced search parameters, the "did you mean?" spellchecking option, and it does not have the 64-result limit.

-- no example available at this time --

Older search interface forms

2007 - Co-op search opens results in a new Google-hosted page

2001 - hosted search opens results in a Google-hosted page

Search WWW Search

For more, see the Google Search Service page,
the review of the Custom Search Engine / 2007, and Google CSE AJAX Decoded

Page Created: 2009-07-24