Light Up IE with Open Search

In my Search presentation at SPC I demonstrated how to tap into Internet Explorer and Firefox’s search capability to detect open search definition files on the server. The technique is quite simple and the resulting effect very powerful. Open search defines where the browser can send a search query to the current site. It also enables visitors to save the settings of the current site as a search provider in order to send a query from any browser session.

The file format looks like the following, fix up the URL to point to your search center.

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>Company Intranet</ShortName>
  <Description> Company Intranet Search</Description>
  <Url type="text/html" template="http://intranet.company.com/searchcenter/pages/results.aspx?k={searchTerms}"/>
  <SyndicationRight>open</SyndicationRight>
</OpenSearchDescription>
  1. Create the file by copying the code above and editing the file to suit your needs. Name the file appropriately, like opensearch.xml.
  2. Copy the file to your server into the /style library/xsl style sheets/ folder. Check-in and publish the file.
  3. Open your master page and add the following line before the closing </head> tag:
<link title="Title" type="application/opensearchdescription+xml" rel="search" href="/Style Library/XSL Style Sheets/opensearch.xml" />
  1. Check-in and publish the master page.
  2. Open your home page in a browser and you should see the internet Explorer 7 search button turn orange.

    IE Search Provider Indication

  3. Select the drop down button and you should see your title as one of the search providers. Company Intranet custom provider

  4. Choose the Add Search Providers menu option and you should see your search provider listed.

    Add search providers

  5. Selecting your search provider should display the following dialog. Security warning

  6. Choose Add Provider and your web site will be listed as an option for searching in Internet Explorer.

    Choose your provider

  7. Test the settings by entering a search term and submitting it to your search center, the results page should render displaying the results of your query.

For SharePoint sites you can add any number of search providers. The following example works for the out of the box People Search page.

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>People Search</ShortName>
  <Description>People Search</Description>
  <Url type="text/html" template="http://intranet/searchcenter/pages/peopleresults.aspx?k={searchTerms}"/>
  <SyndicationRight>open</SyndicationRight>
</OpenSearchDescription>

I find this functionality very popular for Intranets. Of course you could add this functionality to your Internet site as well, but that would really depend on what you are offering the public in the way of search and weather the public is interested in permanently linking to you site for search.

|| Search || Web Publishing

comments powered by Disqus

Let's Get In Touch!


Ready to start your next project with us? That’s great! Give us a call or send us an email and we will get back to you as soon as possible!

+1.512.539.0322