Thursday, May 20, 2010

* SharePoint : Add custom search provider to IE for SharePoint site

Both IE8 and SharePoint/MOSS 2007 are OpenSearch compliant. This enables SharePoint admins to publish a custom search provider for IE users so that users can search the site content from browser search bar.

Here are the steps:

  • Start with identifying the search URL for your site. A typical search url looks like following :

    http://<portal>/_layouts/srchrss.aspx?k={searchTerms} . This returns results in RSS format.

  • Create a search provider xml file. <name>.xml

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:ms-ose="http://schemas.microsoft.com/opensearchext/2009/">
    <ShortName>My Portal</ShortName>
    <Description>Realtime My Portal Search</Description>
    <Url type="application/rss+xml" template="http://<portal>/_layouts/srchrss.aspx?k={searchTerms}"/>
</OpenSearchDescription>

  • Upload the above file to anywhere in document library of your portal.
  • Add a following link on home page of you portal. You can use ‘Content Editor Web Part’.

    <link title="My Portal Search" type="application/opensearchdescription+xml" rel="search" href="<path to file uploaded>" />

  • When you will load the home page in IE, it will show additional search provider as shown below which you can add permanently.

image

1 comment: