Erik Porter's Blog

Life and Development at Microsoft and Other Technology Discussions

News

    Implementing Open Search (A9/Amazon) for IE 7

    Yesterday I setup Microsoft Gadgets and Microsoft 10 to use open search so you'd be able to use the search box in IE 7 to search those sites.  It was very simple to do and I thought I'd shared.

    Create an XML file (I called mine search.xml) and put something like this in it:

    <?xml version="1.0" encoding="UTF-8" ?>
    <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
      <ShortName>Microsoft 10 Search</ShortName>
      <Description>Search on 10</Description>
      <Tags>Microsoft 10</Tags>
      <Contact />
      <Image width="16" height="16" type="image/png">http://on10.net/images/opensearch.png</Image>
      <Url type="text/html" template="http://on10.net/Search/{searchTerms}" />
    </OpenSearchDescription>

    You can view the spec for details here.  I'm not entirely sure what the image element is for, but it's good to set, because you never know who might use it (not just IE 7).  Now add the following in the head element of your html document:

    <link title="Microsoft 10 Search" type="application/opensearchdescription+xml" rel="search" href="http://on10.net/search.xml" />

    Title gives it a name to show in the Search Drop Down List and the href specifies the location of the XML document you created for the definition of your search.  That's all there is to it and now your visitors using IE 7 (or any app that supports open search) will be able to search your site externally.

    Note: At the time of this writing, the open search implementation has not be published to the sites I mentioned.

    Comments

    No Comments