In 2005 Jeff Bezos unveiled the first OpenSearch standard. So what is that?
OpenSearch is a collection of technologies that allow publishing of search results in a format suitable for syndication and aggregation. It is a way for websites and search engines to publish search results in a standard and accessible format.
- Wikipedia (http://en.wikipedia.org/wiki/Open_search)
This was great because it finally provided a framework for sharing search results and defined mechanisms that allowed dispirit technologies to cooperate with one another on requesting searches and managing/rendering results. This meant web developers could expose a set of search descriptors detailing what is available, who is providing it, and the end-point(s) that can service requests. Technologies like browsers can consume these details and make search available to users whether or not they are actually visiting the site at the moment they request the search.

Depending on your particular needs you can provide as much or as little search richness as you like, and this can work just as well for intranets as it does the internet. The best part about this is just how easy it is to implement. Let me walk you through a small sample. Here is what we need:
- A Descriptor; as defined by the OpenSearch standard; detailing our search facility
- A <link> in our page/master page pointing the browser to our descriptor
- A page/end-point to receive search requests and provide an answer
Lets start with the Descriptor. This is simply an XML file; as defined by the spec; that browsers should be able to access
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Sample Search Provider</ShortName>
<Description>Demonstrates how to add Search Provider</Description>
<Tags>Sample Search Tag</Tags>
<Contact>Joe</Contact>
<Url type="application/rss+xml" template="http://localhost:3573/Default.aspx?keywords={searchTerms}"/>
<Url type="application/atom+xml" template="http://localhost:3573/Default.aspx?keywords={searchTerms}"/>
<Url type="text/html" template="http://localhost:3573/Default.aspx?keywords={searchTerms}"/>
<Url type="application/xhtml+xml" template="http://localhost:3573/Default.aspx?keywords={searchTerms}"/>
<LongName>Sample Search Provider</LongName>
<Developer>www.smelser.net</Developer>
<Attribution>
Provided courtesy of www.smelser.net
</Attribution>
<SyndicationRight>open</SyndicationRight>
<AdultContent>false</AdultContent>
<Language>en-ie</Language>
<OutputEncoding>UTF-8</OutputEncoding>
<InputEncoding>UTF-8</InputEncoding>
</OpenSearchDescription>
I filled in a series of details that I feel are commonly used although there are a lot more available in the spec. Take a close look at the below line. This defines the path to the search end-point. You need to define the exact path; including parameters; where search requests are to be submitted. The token {searchTerms} is defined by the spec and will be the collection of search terms supplied by the user.
<Url type="application/rss+xml" template="http://localhost:3573/Default.aspx?keywords={searchTerms}"/>
Now that we have that configured, we need to add a <link> similar to the one below in either your page header or; more ideally; your master page header.
<link runat="server" id="SearchProvider" rel="search" type="application/opensearchdescription+xml" href="/SearchDescriptor.xml" title="Sample Search" />
Now if you visit the site, you will see the sample provider available in the list of search providers:

When a search is submitted, a GET is issued against the registered endpoint. In ASP.NET you can retrieve the request as follows:
Response.Write("The user searched for: " + Request.QueryString);
By parsing the QueryString you can service the search request as you see fit and then render the results. As you can see, this is really easy to implement so this is worth considering as a feature.
Tags: design patterns