Add your search engine to the browser
Published on: July 20, 2006 by Paul Boag
There is a great new feature in both Internet Explorer 7 and Firefox 2, which will allow you to integrate your site search directly into the browser.
I have been surprised how little buzz the new Open Search functionality in the next generation of browsers has received. After all, the additional exposure it could provide websites is considerable.
The concept
Open Search is a very powerful concept but for the purposes of this post, I am just going to focus on what it can quickly and easily offer website owners.
At the most basic level, it allows you to easily add the search functionality from your site to the search box found in the top right of both IE 7 and Firefox 2. Although this search functionality is only available while visiting a site, it does give users the option to save your search engine to their browsers and even set it as the default if they wished.

How to add open search
At first, the documentation associated with implementing open search appears very complex. This is largely because Open Search is capable of doing a lot more than basic browser implementation. However, below I give you the absolute basics to get your search in the browsers search box.
Step One: Create a description
The description is a very simple piece of XML that tells the browser about your search engine. There is a lot more information you can pass across but this is the basics:
<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Boagworld Search</ShortName>
<Description>Search for web site management advice.</Description>
<Tags>Boagworld</Tags>
<Image width="16" height="16" type="image/png">http://www.boagworld/favicon.ico</Image>
<Url type="text/html" template="http://www.boagworld.com/mt/mt-search.cgi?search={searchTerms}" />
</OpenSearchDescription>
Most of the above is hopefully self-explanatory. The most important bit is the URL template attribute. The simplest way of finding out what this is, is to search using the search box on your site. Once you have arrived at the search page, copy and paste the url into the above XML file and replace your search term with {search term}.
However, this will not necessarily work for your search engine. It will depend on the set up on your particular site. For example on boagworld, I had to strip out some of the other parameters being passed across. Other search engines might work in an entirely different way, in which case you will have to refer back to the open search documentation.
Once you have made the changes to your XML file upload it to your server. For this demo I saved it as search.xml and put it on my site's root: www.boagworld.com/search.xml
Step Two: Pointing to your description
The next step is to point the browser at search.xml when it loads your site. You can do this by simply adding one line of code into the header of your pages.
<link title="Boagworld Search" type="application/opensearchdescription+xml" rel="search" href="http://www.boagworld.com/search.xml" />
Rename the title and make sure the href is pointing at your uploaded description.
Once you open the page in either Internet Explorer 7 or Firefox 2 you should see your search engine listed under the search engine dropdown.






Comments
Comments are for the discussion of this post. If you have other questions / comments then post them to the forum or send me an email
Post by Steve Kwan on July 20, 2006 9:23 PM
Post by Paul Boag on July 20, 2006 9:38 PM
Post by Steve Kwan on July 20, 2006 9:41 PM
Post by Joey Livingston on July 21, 2006 3:30 AM
Post by Ed on July 21, 2006 2:23 PM
Post by Ed on July 21, 2006 2:36 PM
Post by Joey Livingston on July 21, 2006 2:58 PM
Post by Paul Boag on July 21, 2006 3:24 PM
Post by Joey Livingston on July 21, 2006 4:36 PM
Post by Ed on August 8, 2006 11:59 AM
Post by Simon Griffiths on October 27, 2006 1:46 AM
Post by Jr on November 24, 2006 2:20 AM
Post by valentinstag on January 1, 2007 10:41 PM
Post by Simon Griffiths on January 25, 2007 11:37 AM
Post by giordana de lorenzo on March 29, 2007 4:26 PM
Post by Allen on March 30, 2007 6:13 PM
Post by Wallace on March 30, 2007 6:14 PM
Post by Shannon on March 30, 2007 6:18 PM
Post by Allison_Cooper181 on April 17, 2007 1:38 AM
Post by Corazon649 on April 17, 2007 8:22 AM
Post by frederick-d-allen on April 18, 2007 1:06 PM
Post by quincy_a_cook on April 19, 2007 3:49 AM
Post by BENJAMIN_A_BROWN532 on April 23, 2007 1:46 AM
Post by Clinton on April 25, 2007 1:17 AM
Post by p on May 8, 2007 4:28 PM
Post by sd on October 17, 2007 5:18 PM
Post by SparK on February 20, 2008 11:57 AM
Post by Simon Griffiths on February 21, 2008 1:05 AM
Post by Simon Griffiths on February 21, 2008 1:07 AM
Post by Simon Griffiths on February 21, 2008 1:10 AM