Freigeben über


Adding Search providers to IE 7 using OpenSearch 1.1

It’s our goal to make it easy for IE7 users to personalize their list of search providers.  The user should be able to target their search directly to site of their choice: MSDN, Intranet portal, Team Sharepoint, PubMed, NYTimes, Costco, USPS, Amazon, WikiPedia, Ebay, Craigslist, etc.  My last blog post mentioned we will be adding extensibility for Internet Explorer’s new Search Box in Beta 2.  We’re announcing the API at PDC during Chris Wilson’s talk on IE7.  Here are the details.

The scenario has two steps:

  1. Users can easily add sites to their list of search providers
  2. Sites describe how IE can interface with them

The user experience for adding a search provider will be very similar to how adding a favorite works today.  Basically all the site needs to do is implement a window.external.AddSearchProvider(“URL”) call in their webpage which will prompt the end user.  When accepted, the search provider will appear in the Search Box dropdown list in IE.  The prompt will also ask if they would like to make this provider the default provider at the same time. 

The URL in this call will be a link to the OpenSearch 1.1 description document for your search query.  Below is an example of a description document for searching on MSDN:

<?xml version=”1.0” encoding=”UTF-8”?>
<OpenSearchDescription xmlns=”https://a9.com/-/spec/opensearchdescription/1.1/”>
            <ShortName>MSDN</ShortName>
            <Description>MSDN Example Search</Description>
            <Tags>MSDN Developer</Tags>
            <Contact>admin@msdn.com</Contact> 

            <Url type="text/html" 
                   template="https://search.microsoft.com/search/results.aspx?qu={searchTerms}&amp;View={language?}&amp;p={startPage?}"/>

</OpenSearchDescription>

In this example when a user searches for “stuff” IE will navigate to: https://search.microsoft.com/search/results.aspx?qu=stuff&View=en-US&p=1.  The cool thing about OpenSearch is that the publisher has a choice of returning RSS or HTML or both.  Here’s an example of a site returning RSS as well as HTML:

<?xml version=”1.0” encoding=”UTF-8”?>
<OpenSearchDescription xmlns=”https://a9.com/-/spec/opensearchdescription/1.1/”>
            <ShortName>MSN</ShortName>
            <Description>MSN Example Search</Description>
            <Tags>MSN Web</Tags>
            <Contact>admin@msn.com</Contact> 

            <Url type=”text/html”
                   template=”https://search.msn.com/results.aspx?q={searchTerms}”/>  

            <Url type="application/rss+xml"
                   template=”https://search.msn.com/results.aspx?q={searchTerms}&amp;format=rss”/> 

</OpenSearchDescription>

How does IE pick which one to use?  IE will choose the first URL specified in the description doc.  In the example above, IE will use the HTML URL since it appears first.  This way, the site has the power to determine how they want the results to appear.  

For more details on creating providers using OpenSearch 1.1 please refer to the OpenSearch Description Document 1.1 Draft.  This format is licensed under creative commons and A9 owns the spec. 

Amar will post soon on how we worked with A9/Amazon to add HTML support to OpenSearch 1.1.

Until next time, keep browsing and have fun!

 - Aaron

Comments

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    Good. Glad to hear. Open Search is the way to go!

  • Anonymous
    January 01, 2003
    What about websites that search via POST requests. For example on my site http://www.teckreviews.com/ users submit their search terms via a POST request and then I filter out bad-words, words that are not too short etc, and if the result is successful I redirect them to a page of their search results.

    So my question is, does the OpenSearch support POST requests :)?

  • Anonymous
    January 01, 2003
    According to http://blogs.msdn.com/ie/archive/2005/09/14/466278.aspx, "it describes HTML output (via <Url type="text/html"/>), supports the POST verb and is a functional super-set of the ‘src’ format.". So it looks like it'll support POST :)

  • Anonymous
    January 01, 2003
    What advantages does using open search give over the current method used by Mozilla and (I think) Opera? As there is an existing implementation, it would seem to make sense to be compatible with that, even if that is hard for Microsoft to do.

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    Ineresting post on the Amazon Web Services Blog:Microsoft's IE blog is reporting on the behind the scenes efforts which lead up to the recent announcement that IE7 will support A9.com's OpenSearch interface. You can read even more about this on the A9 blog. [Amazon Web Services Blog: Behind the Scenes at Microsoft, A9, and Amazon]And the IE Blog's view of why this is important: It's been a lot of fun working with A9. But, this is just the beginning. The OpenSearch spec occupies a special place because it intersects 3 important communities - browser, search and RSS. We want to hear from all of you. My dream is that OpenSearch is adopted by all the browsers and millions of sites (Internet and Intranets) and that a significant percentage of these sites also expose RSS. [IEBlog : IE7 and OpenSearch: Behind the scenes]...

  • Anonymous
    January 01, 2003
    to Ian Thomos:

    The search plugins used by Mozilla/Firefox/etc (see http://mycroft.mozdev.com ) are based on the format used by Apple's Sherlock. Mozilla did the best thing at the time, using an existing 'standard' (see http://mycroft.mozdev.org/deepdocs/quickstart.html#standard )

    Now, however, there's a new format OpenSearch, which is truly open (the 1.1 draft has a Creative Commons license), and it's also in XML, which is much more in-tune with Mozilla's practices than the existing plugins.

    I'm quite familiar with both specifications, and I really think OpenSearch is substantially better. It isn't complicated, makes use of the existing standards of RSS/Atom, has virtually all the features of the 'src' search plugins and more, and is fully extensible.

    It should be a relatively easy operation to convert an existing 'src' plugin into an OpenSearch Description document. Which, by the way, can use the <link /> tag in HTML to provide auto-discovery, which is very cool, just like RSS/Atom has today.

  • Anonymous
    January 01, 2003
    As reported by the Amazon Web Services Blog and the IEBlog there have been some behind the scenes efforts between the Microsoft IE7 development team and their colleagues at Amazon's A9 to roll Opensearch capability into the next IE release....

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    February 06, 2006
    It is snowing outside, I have a cup of coffee playing with new IE7! I have installed yesterday. It has...

  • Anonymous
    February 07, 2006
    For those of you interested in more information on how IE7 takes advantage of OpenSearch check out the...

  • Anonymous
    February 09, 2006
    For those of you interested in more information on how IE7 takes advantage of OpenSearch check out the...

  • Anonymous
    February 09, 2006
    For those of you interested in more information on how IE7 takes advantage of OpenSearch check out the...

  • Anonymous
    February 10, 2006
    Several parties have made claims about how search works in IE7. I think those
    claims are awfully confusing,...

  • Anonymous
    April 04, 2006
    OpenSearch

  • Anonymous
    April 04, 2006
    OpenSearch

  • Anonymous
    April 04, 2006
    OpenSearch

  • Anonymous
    April 07, 2006
    I'm loving the work many of my former teammates are doing over on IE7.
    Keyboard (or mouse)&amp;nbsp;shortcut's...

  • Anonymous
    June 15, 2006
    The comment has been removed

  • Anonymous
    June 24, 2006
    PingBack from http://www.junyent.org/blog/arxius/2006/06/24/nous-motors-de-cerca-per-a-firefox-20-i-ie7/

  • Anonymous
    August 28, 2006

    &lt;p&gt;I've recently had to look up a few APIs at &lt;a href=&quot;http://www.pinvoke.net/&quot; class=&quot;ExternalLink&quot;&gt;http://www.pinvoke.net/&lt;/a&gt; so I thought I'd whip up an &lt;a href=&quot;http://en.wikipedia.org/wiki/OpenSearch&quot;

  • Anonymous
    October 03, 2006
    PingBack from http://blogcentral.dk/byteme/2006/06/27/ingdk-s%c3%b8geplugin-til-firefox/

  • Anonymous
    October 12, 2006
    PingBack from http://xml-utils.com/?p=19

  • Anonymous
    October 19, 2006
    O možnosti přidání vlastního vyhledávání do Internet Exploreru 7 psal už dávno Michal Altair Valášek

  • Anonymous
    December 20, 2006
    PingBack from http://www.pablog.ch/?p=

  • Anonymous
    February 29, 2008
    The comment has been removed

  • Anonymous
    March 10, 2008
    PingBack from http://kronkltd.net/blog/2005/09/19/opensearch-now-supported/

  • Anonymous
    April 18, 2008
    [2 blogs ago (back on what is now windows-now.com), I blogged about the IE7 Search Bar + Open Search

  • Anonymous
    March 22, 2009
    PingBack from http://vistahome.org/2009/03/22/windows-7-federated-search/

  • Anonymous
    May 29, 2009
    PingBack from http://paidsurveyshub.info/story.php?title=ieblog-adding-search-providers-to-ie-7-using-opensearch-1-1

  • Anonymous
    June 15, 2009
    PingBack from http://einternetmarketingtools.info/story.php?id=11358