Sunday, January 31, 2010

Creating a Scope and Tab for MOSS Search Center

Creating a Scope and Tab for MOSS Search Center
I am occasionally asked how to create a tab in the MOSS Search Center to search a given scope. This process is often confusing to administrators because it involves the creation of a scope, making the scope available, and then the creation of not just one, but two tabs in Search Center along with ASPX pages. Before beginning, this article assumes that you already have the Shared Services Provider (SSP) properly set up and that you have a "Search Center with Tabs" site available in your portal. For my example, I'll create a tab designed to search a specific document library that contains HR documents. Note that this article does not cover creating an "Advanced Search" capability - just a simple keyword search.
Create the Shared Scope
The first step is to create a Shared Scope that will target the document library. This Shared Scope will be set up in the Shared Services Provider using the following steps:
On the home page of the Shared Services Administration site, click "Search Settings"
On the Search Settings page, click "View Scopes"
On the View Scopes page, click the "New" button
On the Create Scope page- Enter HR Documents in the Title field- Leave the results page using the default page, you'll change that later- Click the OK button.
On the View Scopes page, locate the new scope and click the "Add Rules" link
On the Add Scope Rule page- Set the Scope Rule Type to "Web Address"- Set the Web Address to "Folder"- Enter the complete URL to the Document Library (e. g. , http://litwareinc.com/HR/HR%20Documents).- Click the OK button.
Return to the Search Settings page
Under the Scopes section, click the "Start Updates Now" link
When you have completed creating the scope and updating it, you should be able to see that it contains a number of documents. This is a good check that you have created the scope correctly and it contains the number of documents that you expect.
Make the Shared Scope Available in the Site Collection
An optional step is to make the new scope available to the site collection where the Search Center is located. Follow these steps to do that:
From the home page of your portal, select Site Actions>>Site Settings>>Modify All Site Settings
On the Site Settings page, under the Site Collection Administration page, click the "Search Scopes" link
On the View Scopes page, you should see the new scope listed under the Unused Scopes section. At this point, you could easily add the scope to the Search Dropdown that appears at the top of the page in MOSS by clicking on the "Search Dropdown" link appearing in the "Display Group: Search Dropdown" section. However, our goal is to create a tab for the search scope.
Create the Search Center Tab
New tabs for Search Center involve several different parts. First, you must create a search page. Then you must create a search results page. Finally, you must associate the scope with the new pages and create tabs to display them. Follow these steps to get it all working:
From the Search Center page, select Site Actions>>Create Page
On the Create Page- Enter HR Documents Search in the Title field- SharePoint should automatically generate a valid page name- Select "Search Page" from the list of available Page Layouts- Click the Create button
A new page should now be visible with a Search Box web part- Select Modify Shared Web Part from the web part's edit menu- Expand the Miscellaneous section- Enter HRDocumentsResults.aspx in the Target Search Results Page URL field (you will create this page next)- Uncheck the box labeled "Display Advanced Search Link"- Click the OK button- Click the Publish button at the top of the page
From the new page, select Site Actions>>Create Page
On the Create Page- Enter HR Documents Search Results in the Title field- SharePoint should automatically generate a valid page name- Select "Search Results Page" from the list of available Page Layouts- Click the Create button
A new page should now be visible with a several search web parts- Select Modify Shared Web Part from the Search web part's edit menu- Expand the Miscellaneous section- Enter HRDocumentsResults.aspx in the Target Search Results Page URL field- Uncheck the box labeled "Display Advanced Search Link"- Click the OK button- Select Modify Shared Web Part from the Search Core Results web part- Expand the Miscellaneous section- Enter HR Documents in the Scope field- Click the OK button- Click the Publish button at the top of the page
From the new page, select Site Actions>>View All Site Content
On the All Site Content page, click the "Tabs in Search Pages" link
On the Tabs in Search Pages list, click the New button
On the New Item page- Enter HR Documents in the Tab Name field- Enter HRDocumentsSearch.aspx in the Page field- Click the OK button
From the list, select Site Actions>>View All Site Content
On the All Site Content page, click the "Tabs in Search Results" link
On the Tabs in Search Results list, click the New button
On the New Item page- Enter HR Documents in the Tab Name field- Enter HRDocumentsSearchResults.aspx in the Page field- Click the OK button
Return to the Search Center home page and you should now see a new tab visible for HR Documents.
Try out a search and verify the expected results.
http://scothillier.spaces.live.com/blog/cns!8F5DEA8AEA9E6FBB!734.entry