in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

Real-World SharePoint Experiences by John Powell

Real-word experiences planning, implementing, customizing and supporting SharePoint.

Search SharePoint from the IE 7 Toolbar

Here is an easy way to search a SharePoint site from the IE toolbar without having to develop an add-in. 

Microsoft implemented open search in IE 7.  Here's how it works: when a user browses to your site, the search provider drop down lights up.  If they click the drop down, they will see your custom search provider that they can add temporarily or permanently to their list of search providers.  Here's an example:

To temporarily use your custom search provider, the user simply selects the menu item and the search box will change (note that the yellow star indicates the search provider is temporary).  For example:

To permanently add your custom search provider, the user selects Add Search Providers and selects it:

The following dialog appears:

After that, your custom search provider will remain in the list (note there is no yellow star, indicating when the user navigates away from your site, the search provider will remain).

When the users searches from the search box, they are taken to the SharePoint search results page.

Here's how to implement it.

Place the following tag in the home page of your site.  You can put it anywhere in the page (but put it in the <head> element if possible).

<link title="SharePoint Search" type="application/opensearchdescription+xml" rel="search" href="SharePointSearchProvider.xml" />

Then create an XML file using the following code and upload it to a url that matches the href attribute in the link tag.

 <?xml version="1.0" encoding="UTF-8"?>
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
   <ShortName>SharePoint Search</ShortName>
   <Description>Search SharePoint from Internet Explorer</Description>
   <Tags>SharePoint Search</Tags>
   <Contact>john@johnwpowell.com</Contact>
   <Url type="text/html"
        template="http://yoursharepoint.com/searchcenter/Pages/Results.aspx?k={searchTerms}"/>
 </OpenSearchDescription>

You can see that open search is simply passing the search term to the SharePoint search results page using the k (keyword) parameter.  There is a special token {searchTerms} that will be replaced with the text the user types in the search box.

I'll leave it you how you want to deploy the xml file and insert the link element into the page.  One simple approach is to upload the XML file to a document library and use a content editor web part for the link tag. 

Here are the full specifications for open search: http://www.opensearch.org/Specifications/OpenSearch/1.1#OpenSearch_description_document

 

Comments

 

Peter {faa780ce-0f0a-4c28-81d2-3667b71287fd} said:

This is excellent. Now the question is, of course: how do we deploy SharePoint search as the default provider enterprise-wide? (I'm not actually asking)

This could be an awesome way to encourage users to use search.

July 11, 2007 10:30 AM
 

John Powell, PMP, MCPD, MCSD said:

Check out the IE 7 Administrator toolkit and group policies:

blogs.msdn.com/.../536353.aspx

July 11, 2007 10:55 AM
 

Jeremy McMahan said:

Is this a SharePoint 3 only trick? I have tried setting it up to a SharePoint 2 site using the url of "mysharepointservername/.../searchresults.aspx{searchTerms}" and it doesn't want to work. I get an error: "Inernet Explorer could not install this search provider. There was a problem with the search provider's information." when trying to add the search provider.

Thanks!

July 11, 2007 4:58 PM
 

Jeremy McMahan said:

Fixed it...

Note to the others out there. Make sure you save your XML file as ANSI text, not Unicode. :-)

July 11, 2007 6:42 PM
 

$blog_title said:

Pingback from  $blog_title

July 21, 2007 10:38 AM

Leave a Comment

(required )  
(optional )
(required )  
Add

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts