Opensearch Cheat Sheet

ADVERTISEMENT

Licence: Made available by subject to the terms of the
Creative Commons Attribution-ShareAlike 2.5 License.
OpenSearch
Sources: Information compiled from and
Firefox
v.1.1 Draft 3
Cheat Sheet
Cheat sheet v. 1.5 (September 2008) by Gareth J M Saunders
INTRODUCTION
OpenSearch is a collection of simple formats for the sharing of search results. The OpenSearch description document format can be used to describe a search engine so that it
can be used by search client applications. For example, in Firefox 3.0 (below left) the search box glows yellow when a site with an OpenSearch description is discovered; in Inter-
net Exporer 7 (below right) the button glows orange:
The OpenSearch response elements can be used to extend existing syndication formats, such as RSS and Atom, with the extra metadata needed to return search results.
AUTO-DISCOVERY OF SEARCH PLUG-INS
Search engines that publish OpenSearch description documents can assist search clients in the discovery of OpenSearch interfaces through the use of “link” elements. To support
auto-discovery you simply need to add one line to the <head> section of your web page:
<link rel="search"
href="
type="application/opensearchdescription+xml"
title="Content
Search" />
ELEMENTS
T
F
R
A
C
D
AGS
ORMAT
EQUIRED
TTRIBUTES
HAR LIMIT
ESCRIPTION
<xml version="1.0" encoding="utf-8" ?>
-
<OpenSearchDescription>
Plain text
Yes
Root node of the OpenSearch description document.
xmls
Yes
The xmlns attribute is important, without it you could get an error message
indicating that "Firefox could not download the search plug-in from:
(URL)".
Two xmlns attributes can be used, the first is the default:
xmlns="
the second is for Firefox and optional:
xmlns:moz="
search/"
<ShortName>
Plain text
Yes
-
16
Human-readable title that identifies this search engine.
<Description>
Plain text
Yes
-
1024
Human-readable title description of the search engine.
<Url>
Plain text
Yes
Interface by which a search client can make search requests.
template
Yes
Search URL template to be processed, use {searchTerms} parameter, e.g.
<Url template="
{searchTerms}&amp;site="StAndrews_ITS">
Yes
type
MIME type of search result format,
e.g. type="application/xhtml+xml" or type="application/
rss+xml". There are two URL types that Firefox supports:
type="text/html" is used to specify the URL for the actual search
query itself; type="application/x-suggestions+json" is used
to specify the URL to use for fetching search suggestions.
No
method
Options are POST and GET, note that IE7 doesn't support POST.
indexOffset
No
Index number of first search result (integer; default=1).
pageOffset
No
Page number of first search results (integer; default=1).
<Param>
Plain text
No
Used within the <Url> element, the parameters that need to be passed in
along with the search query, as key/value pairs. When specifying values,
you can use {searchTerms} to insert the search terms entered by the user
in the search bar. Note: IE7 does not support this element.
<SearchForm>
Plain text
No
Firefox-only The URL to go to to open up the search page at the site for
which the plug-in is designed to search. This provides a way for Firefox to
let the user visit the web site directly.
Since this element is Firefox-specific, and not part of the OpenSearch
specification, we use the "moz:" XML namespace prefix in the example
above to ensure that other user agents don't support this element can
safely ignore it, e.g. <moz:SearchForm>http://
<Contact>
Email
No
Email address of the maintainer of the description document.
<Tags>
Plain text
No
Keywords to identify and categorize this search content.
Single words, delimited by spaces “ “.
48
<LongName>
Plain text
No
Extended human-readable title that identifies this search engine.

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2