OpenSearch

From IndieWeb
Jump to: navigation, search


OpenSearch is a specification for search engine discovery and syndication of search results. According to OpenSearch's Introduction, "OpenSearch is a collection of simple formats for the sharing of search results."

OpenSearch descriptions are specifically-formatted XML documents that site authors may link to from within an HTML page. OpenSearch-aware browsers may then allow users to take advantage of the site author's specified search engine.

Example

<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>example.com</ShortName>
  <Description>Search example.com.</Description>
  <Url type="text/html" template="http://example.com/?q={searchTerms}"/>
</OpenSearchDescription>

The OpenSearch 1.1 Draft specification fully details the required and optional elements that may be included in an OpenSearch description.

Implementations

Browser UI Examples

Chromium 48

In the following example, a user has previously visited cweiske.de and Chromium recognizes its OpenSearch description, indicated by the following markup in the page's <head>:

<link rel="search" title="cweiske.de" type="application/opensearchdescription+xml" href="/opensearch.xml"/>

Typing "cweiske.de" in the browser's search bar shows the message, "Press tab to search cweiske.de":

opensearch chromium init.png

After pressing tab, "Search cweiske.de" in the browser's search bar is presented with a blue background and a user can type a search term:

opensearch chromium input.png

Pressing return, the user initiates a search and is presented a search results page:

opensearch chromium results.png

IndieWeb Examples

Articles

Blog posts and articles about OpenSearch:

See Also