help   |   preferences

Why Should I Upgrade?

OpenSearch 1.0 was a first attempt at syndicating search results in an open format. OpenSearch 1.1 is a more mature format, including many changes that came about from comments on the first version. It is more powerful, flexible, and extensible.

Additionally, more and more software that produces and consumes OpenSearch will make use of the new format. You can see a good listing of these on OpenSearch Readers and OpenSearch Writers.

But I don’t want to!

This upgrade is actually very simple. Bear in mind that this document explains what is required to upgrade; there are other optional changes that can be made to take advantage of new functionality.

XML Namespace

With 1.1, all components of the OpenSearch specification fall under one namespace: http://a9.com/-/spec/opensearch/1.1/. You will need to change this on both the OpenSearch Description and the OpenSearch Response (formerly called OpenSearch RSS).

Upgrading the Description

Url Element

This is the most important change. Move the URL from a child text node to the template attribute. Here is the old method:

    <Url>http://example.com/?q={searchTerms}</Url>

And here is the new one:

    <Url type="application/rss+xml"
         template="http://example.com/?q={searchTerms}" />

As you can see, there is also a new type attribute, which is required. If you were using OpenSearch RSS, then use the type shown above. See Query Syntax for details.

Example Search

Example searches now use the new unified way of referencing a query. Here is the old method:

    <SampleSearch>cat</SampleSearch>

And here is the new one:

    <Query role="example" searchTerms="cat" />
Format Element

Get rid of the Format element. It’s gone.

MIME type

OpenSearch Description files should now be served with the application/opensearch+xml MIME type, which is pending IANA registration.

Optional Changes

Multiple Image and Url elements are now allowed, as are better internationalization support and more. See the specification for details.

Upgrading the Response

OpenSearch 1.1 allows multiple response formats, not just RSS. The only change required for upgrading is the XML namespace, however the new version includes support for suggested searches, among other things.

Autodiscovery

Autodiscovery provides a great mechanism for finding OpenSearches for a given website (from HTML pages). It is not a requirement, but strongly recommended. Here is how it might look:

    <link type="application/opensearchdescription+xml" rel="search" href="opensearch-description.xml" />

See autodiscovery for complete details.

Further Reading

For complete details about the changes between versions 1.0 and 1.1, please see the changelog.