Back to home


Welcome to the OpenSearch Demo page.

You must have seen list of search engines in mozilla search bar (usually to the right end after address bar). There are a list of sites like Google, Yahoo, Wikipedia on the list from which we can choose the default search engine.
These sites are OpenSearch enabled. The Mozilla browser can directly send search queries from the search bar to these sites. There are lot of sites which are OpenSearch enabled. We can easily identify a site is OpenSearch by looking at the arrow icon on the search bar in Mozilla.
If the site is OpenSearch enabled, there will be glow for the arrow icon

.

You can click the arrow to see the option "Add " so that the search the site will also get listed in the search engine list. You can search that site by directly entering the search term on the mozilla browser search box and selecting the site from the list of search engines.


Now, let us check how to enable our site with OpenSearch.
First we need to create an XML file that specify the query string and url for the search. The content of the XML below should be self-explanatory.

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>www.prasanthkumars.com</ShortName>
<Description>
Demo for opensearch using xml.
</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">http://www.prasanthkumars.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://www.prasanthkumars.com/searchdemo.asp?q={searchTerms}"/>
</OpenSearchDescription>


The URL method specifies that it will be a GET to the URL specified in the template. Note the 'q={searchTerms}' phrase at the end of the URL. The browser will replace '{searchTerms}' with the search term entered by the user before requesting the server.

Now you need to specify that the site is OpenSearch enabled to the browser by adding the following link inside the '<head>' tag of the pages.

<link rel="search" type="application/opensearchdescription+xml" title="www.prasanthkumars.com" href="/opensearch.xml">



That is it. Now your site is OpenSearch enabled.

Check the demo. Add this site to the list of search engines and try searching.