Wednesday, November 5, 2008

Search Add-ons (Providers) on MOSS search result in IE7 / Firefox

Today while reading an article found a very good trick for configuring the search provider/ add-ons for your favorite browser. Which allows you to quick websearch. Now how about doing quick search on your MOSS installation. I'll show you step by step for doing this.

First basics of search. I know the various ways how sharepoint handles search requests. Back from SPS 2003 configuration , advanced webpart development till Moss2007 integrated search.
For our purpose, we will use the query string keyword search( As other search options are postback with some compulsory parameters to the search result webpart in results.aspx page.
http://portal/searchcenter/Pages/Results.aspx?k=dhyan&Scope=All Sites.

<?xml version="1.0" encoding="utf-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Search corporate</ShortName>
<Description>Searching the Corporate MOSS sites</Description>
<Url type="text/html" template="http://portal/searchcenter/Pages/Results.aspx?k={searchTerms}&amp;s=All%20Sites"/>
</OpenSearchDescription>


As it shows: k={key word you want to pass}, Scope= {The scope defined in the portal SSP or simple All sites}

Now you create a XML file with your notepad update the content given below and upload it to a document library in your moss. Its required to call the XML from your Fav. Browser so that it installs the XML configuration for your search Add-on.

Add javascript code in a file or in a content webpart of a page and publish it.

<a href="javascript:window.external.AddSearchProvider('http://portal/adp/pages/search_add.xml');">Add Corporate Search </a>

While I after uploading my XML file named as search_add.xml , I simply refreshed the page to show the link "Add Corporate Search". And it will ask for your permission to add in the search provider. Click "yes", and choose default search provider option
Now done you can do search on the keyword from your browser on your Moss installation site.