Tags That Describe the Collection of Results from the Query

These tags provide metadata about the search results themselves. The following example describes how Google displays this information at the top of a page of search results.

Results <b><GDStartIndex/> - <GDEndIndex/></b>
  of about <b><GDEstimatedTotalResultsCount/></b>
  for <b><GDSearchQuery/></b>
  (<b><GDSearchTime/></b> seconds)

GDSearchComments

Message intended for display to an end user. One of the most common messages found here is a note that "stop words" were removed from the search automatically (this happens for very common words such as "and" and "as").

Note: Although Google declares that this message will be returned through their web API, I have only seen it return null.

GDEstimatedTotalResultsCount

The estimated total number of results returned for the query.

AttributesTypeDefaultDescription
formatbooleantrue Choose to format the number so that commas appear between every set of three digits, making it easier to read. Unformatted, a big number may appear as 37600000; however if that number were formatted, then it would appear as 37,600,000.

GDSearchQuery

The query string that generated this result.

GDStartIndex

The index (1-based) of the first search result in the result elements.

GDEndIndex

The index (1-based) of the last search result in the result elements.

GDSearchTips

A message intended for display to the end user; provides instructive suggestions on how to use Google.

Note: Although Google declares that this message will be returned through their web API, I have only seen it return null.

GDSearchTime

Total server time to process the query (in seconds).

Tags That Describe the Individual Results from the Query

The template inside the <GDResults> tag will be applied to each search result from the query. Thus, all tags that start with GDResult may only be used inside this tag. Below is a rough example of how these tags could be used to model Google's existing layout for search results (though this would display the results in reverse-alphabetical order).

<GDResults order="title" ascending="false">
<p>
  <a href="<GDResultURL/>"><GDResultShortcutIcon/> <GDResultTitle/></a> <br/>
  <font size="-1">
    <GDResultIfSnippet>
      <!-- the snippet will only display if it is non-null -->
      <GDResultSnippet/> <br/>
    </GDResultIfSnippet>
    <font color="#008000"><GDResultURL/> - <GDResultCachedSize/></font>
    - <GDResultCachedPage/> - <GDResultSearchRelated/> <br/>
  </font>
</p>
</GDResults>

If http://www.bolinfest.com/dominoes/ were among the list of search results, then it would appear as:

Google Dominoes

Google Dominoes. ... Google Dominoes is an extension for either the Firefox or Mozilla

web browser that provides you with a special kind of Google toolbar. ...

http://www.bolinfest.com/dominoes/ - 3k - Cached - Similar Pages

GDResults

A container tag that represents the search results from your query. Currently, the GDResults tag may only appear once in your template.

AttributesTypeDefaultDescription
ordervisited, google, or titlevisited For visited, links in your browser history will be listed before those not in your history.

For google, results will be listed in the order returned by Google.

For title, results will be listed in alphabetical order by the title of each result.

ascendingbooleantrue If true, then items will be sorted in the default order of the sort (A-Z, 1-10, etc.).

GDResultURL

The absolute URL of the search result (without HTML formatting).

GDResultTitle

The title of the search result, formatted as HTML to highlight the search terms. If no title is available, then the URL of the search result will be used (without HTML formatting).

GDResultIfSnippet

A container tag for the <GDResultSnippet> tag. If there is a snippet for the search result, then any HTML within this tag will be printed and each <GDResultSnippet> will be replaced with the value of the snippet.

GDResultSnippet

A snippet which shows the query in context on the URL where it appears. This tag may only appear between open and closing <GDResultIfSnippet> tags.

GDResultIfSummary

A container tag for the <GDResultSummary> tag. If there is an ODP summary for the search result, then any HTML within this tag will be printed and each <GDResultSummary> will be replaced with the value of the ODP summary.

GDResultSummary

The ODP summary if this document is contained in the ODP directory. This tag may only appear between open and closing <GDResultIfSummary> tags.

GDResultCachedSize

The size in kilobytes of the cached version. This is 0 if the cached version of the URL is not available.

GDResultSearchRelated

Provide a hyperlink to search for pages similar to this one.

AttributesTypeDefaultDescription
labelstringSimilar PagesThe text that appears in the hyperlink.

GDResultCachedPage

Provide a hyperlink to Google's cached version of this page.

AttributesTypeDefaultDescription
labelstringCachedThe text that appears in the hyperlink.

GDResultShortcutIcon

Load the "favorites" icon for the web site, if available. If the URL of the site is something like http://www.somesite.com/subdir1/subdir2/index.html, then GDResultShortcutIcon will do the following:

  1. It will check to see if http://www.somesite.com/subdir1/subdir2/favicon.ico exists. If it does, then favicon.ico will be displayed. If not, then it will go to step 2.
  2. It will check to see if http://www.somesite.com/favicon.ico exists. If it does, then favicon.ico will be displayed. If not, then it will not display anything.

AttributesTypeDefaultDescription
bordernonnegative integer0The width of the image border, in pixels.

GDResultGoogleIndex

The index (1-based) of the result within the list of search results in the order that Google returned it.

GDResultSortedIndex

The index (1-based) of the result within the list of search results after the search results have been sorted. Thus, if the order of the <GDResults> tag is google, then the <GDResultGoogleIndex> of a search result will be the same as its <GDResultSortedIndex>. If a different order is used, then the <GDResultSortedIndex> of the result may be different, as the position of the result within the result list may have changed due to sorting.

Spelling Tags

The spelling tags can be used together as follows:

<GDIfSpellingSuggestion>
<p><font color="red">You probably meant to search for:</font> <GDSpellingSuggestion/></p>
</GDIfSpellingSuggestion>

Thus, if the user used Google Dominoes to query for pairr of pantz, then he would see:

You probably meant to search for: pair of pants

But if he searched for pair of pants, then he would see no additional HTML at all because Google does not provide any spelling suggestions for that query.

GDIfSpellingSuggestion

A container tag for spelling suggestions. The only tag that will be recognized inside the GDIfSpellingSuggestion tag is the GDSpellingSuggestion tag.

GDSpellingSuggestion

The spelling suggestion for the query.

AttributesTypeDefaultDescription
linkbooleantrue If true, the suggested spelling will appear in a hyperlink. Clicking this hyperlink results in a Google Dominoes search with the suggested spelling as the value of the query.

Miscellaneous Tags

The Miscellaneous Tags may be used together to create the familiar Google search box. The following template

<table>
<tr>
  <td><font size="+2"><GDGoogleLogoKnockoff/></font></td>
  <td><GDSearchBox size="40" searchLabel="Search Google" luckyLabel="Feeling Lucky?"></td>
</tr>
</table>

would render the following HTML:

Google 
Web    Images    Groups    News    Froogle    more »

GDGoogleLogoKnockoff

This is a hokey HTML representation of the Google logo that is so poor that it is unlikely to violate any copyright laws (though I believe that this approximates what was displayed on the original Google home page).

GDSearchBox

This is a text box with a search button to perform another Google Dominoes query.

AttributesTypeDefaultDescription
sizepositive integer50The size of the <input> text box.
searchLabelstringSearch The text that appears on the first button for the form. This button will do a Google Dominoes search for the value in the text box.
luckyLabelstringI'm Feeling Lucky The text that appears on the second button for the form. This button will do a Google Dominoes "I'm Feeling Lucky" search for the value in the text box.

GDResultPageNavigation

This provides a set of navigation links to go to the next or previous page of search results.

GDIfNoResults

A container tag that contains HTML that will be displayed if there are no results for the query. Other tags may be contained within this tag. Here is an example of how the tag could be used to imitate the message that Google displays when there are no search results.

<GDIfNoResults>
Your search - <b><GDSearchQuery/></b> - did not match any documents.<br/>
No pages were found containing <b>"<GDSearchQuery/>"</b>.
</GDIfNoResults>