Exercise 1: Customizing Search Center
In this exercise, you will customize the Search Center to create the foundation for a search-based application. You will create a task list as a data source and then add a scope for the list. Finally, you will create a Search Center with custom settings to search the new scope.
IMPORTANT: Before you begin these steps, make sure that you have the Standard, Enterprise, and Publishing features activated at both the Site Collection and Site levels.
- 1.If you haven’t already done so, run the batch file named SetupLab11.bat, found in the c:\Student\Labs\11_Search\ folder, to create the new site collection that will be used to test and debug the code you will be writing in this lab. This batch file creates a new site collection at an URL of https://intranet.contoso.com/sites/Lab11.
- Launch Internet Explorer and browse to https://intranet.contoso.com/sites/Lab11.
- Verify that you have the Standard, Enterprise, and Publishing features activated at both the Site Collection and Site levels:
- Select Site Actions » Site Settings » Site Collection Features (in the Site Collection Administration section)
- Verify that the three features are active or activate them if necessary.
- Use the breadcrumbs to navigate back to Site Settings
- Select Manage Site Features (in the Site Actions section)
- Verify that the three features are active or activate them if necessary.
- Now you need to create a new task list to hold some sample data we’ll index:
- Select Site Actions » View All Site Content.
- Click Create and create a new Tasks list for the site named Project Tasks.
Using the picture below, add these tasks to the list. Make sure to use the High/Normal/Low priority settings on these tasks as you will configure custom relevance rankings in a later exercise.
- Now you need to create a Search Center sub site, but before doing that, you REALLY need to verify the necessary features are active.
- Select Site Actions » Site Settings.
- Pick Site collection features under the Site Collection Administration section.
- Verify the following features are active. If they aren’t, activate them:
- Office SharePoint Server Enterprise Site Collection features
- Office SharePoint Server Publishing Infrastructure
- Office SharePoint Server Standard Site Collection features
- Verify the similar corresponding three (3) features are active at the site level (Site Actions » Site Settings » Manage site features under the Site Actions section).
- Next, we need to create a new Search Center sub site in the Lab11 site.
- Select Site Actions » New Site.
- Select the Search tab.
- Select the Enterprise Search Center.
- Enter Search Center in the Title field (i.e. first text box).
- Enter searchcenter in the URL field (i.e. second text box).
- Click the Create button.
- With the Search Center site created the next step is to modify the publishing pages within the Search Center. First create a new page that will search for important tasks:
- Browse to https://intranet.contoso.com/sites/Lab11/searchcenter. On the new search site, click Site Actions » View All Site Content.
- Select the Pages library.
- In the Pages library, click Documents » New Document » Page on the ribbon.
- Select to create a new (Welcome Page) Search Box and use the following to create the page:
- Next create the search results page for important tasks:
- In the Pages library, click Documents » New Document » Page on the ribbon.
- Select to create a new (Welcome Page) Search Results and use the following to create the page:
- Now you need to add a new tab to the https://intranet.contoso.com/sites/Lab11/searchcenter homepage.
- On the new search site, click Site Actions » View All Site Content.
Click the Tabsin Search Pages library.
Figure 4
View all site content
Select Items » New Item from the ribbon and use the following to create the new tab:
- Tab Name: Important Tasks
- Page: ImportantTasks.aspx
Figure 5
Create the new tab
- Click the Save button.
- With the new tab created, you now need to configure that tab to send users who execute searches on it to the custom results page.
- Browse to https://intranet.contoso.com/sites/Lab11/searchcenter.
- Click the Important Tasks tab to jump to the ImportantTasks.aspx page.
- Select the Edit button on the Page tab in the ribbon.
- In the Web Part that contains the search box, click the Web PartMenu drop down arrow in the right upper corner of the web part and pick Edit Web Part.
In the Search Box task pane, expand the Miscellaneous section. Change the Target search results page URL from results.aspx to ImportantTasksResults.aspx and click OK at the bottom of the task pane.
Figure 6
Configure the search box
- Now check the page in to save your changes. You can find the Check in button on the Page tab.
Now that the new Search Center is created, you will create a search scope to use with it. The search scope will include only the task list you created earlier.
- Open the SharePoint 2010 Central Administration site.
- Click Application Management » Manage Service Applications.
- On the Manage Service Applications page, click the Search Service Application link. This brings you to the Search Administration page.
- Click the Scopes link in the Quick Launch bar under the Queries and Results section.
- On the View Scopes page, click New Scope.
- On the Create Scope page, enter Important Tasks in the Title field
Enter ImportantTasksResults.aspx for the Target Results Page and click the OK button.
Figure 6
Set the results page
- When the new scope is created, click the Add Rules link in the Upgrade Status column to add a rule to the scope. We will filter the results to include only those from our list we created previously.
Leave the Web Address option selected and enter the complete URL to the task list (e.g. https://intranet.contoso.com/sites/Lab11/Lists/Project%20Tasks) in the Folder field in the Web Address section.
Figure 7
Configure a rule for the new scope
- Click the OK button.
With the scope created you now need to start a full crawl.
- Click the Content Sources link in the Quick Launch under the Crawling section.
- Select the Local SharePoint sites and then Start Full Crawl to trigger the search indexer to index all the content in our new task list.
Figure 8
Start a full crawl
- Wait for the full crawl to finish (about 5 minutes).
Finally, you need to update the scope. This will happen automatically but not for quite a while. Let’s force it to update the scope now:
- Select Search Administration from the top of the Quick Launch.
- In the System Status section, you’ll see that the 2nd to last item reports one scope is pending update. Click the Startupdatenow link to initiate it.
Figure 9
Start the update
- Your search scope is now ready for use.
Once the new scope is ready, you must return to the Search Center and edit the web parts so that they will use the new scope.
- Return to the Search Center (https://intranet.contoso.com/sites/Lab11/searchcenter) and click the Important Tasks tab. This will take you to the ImportantTasks.aspx page.
- Enter a term and perform a search. This will take you to the ImportantTasksResults.aspx page.
- Select Site Actions » Edit Page to place the page in edit mode.
- In the Web Part that contains the search box, click the arrow in the right upper corner of the web part and pick Edit Web Part.
- In the Search Box task pane, expand the Miscellaneous section. Change the Target search results page URL from results.aspx to ImportantTasksResults.aspx and click OK at the bottom of the task pane.
- On the Search Core Results Web Part, select Edit Web Part from the Edit menu (in the right upper corner of the web part) (Note: once you select the edit option you may need to scroll the web page up to the top to see the Search Core Results edit options.).
Under the Location Properties section, select Local Search Results in the Location property and enter Important Tasks in the Scope property.
Figure 10
Configure Search Core Results
- Click the OK button.
- Check In the page.
You should now be able to return results from the task list you created earlier.
Figure 11
The search result page
In this exercise you created a new Search Center site and customized it to use a new search results page that leverages a custom scope you created.