Share via


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. 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.
  2. Launch Internet Explorer and browse to https://intranet.contoso.com/sites/Lab11.
  3. Verify that you have the Standard, Enterprise, and Publishing features activated at both the Site Collection and Site levels:
    1. Select Site Actions » Site Settings » Site Collection Features (in the Site Collection Administration section)
      1. Verify that the three features are active or activate them if necessary.
      2. Use the breadcrumbs to navigate back to Site Settings
    2. Select Manage Site Features (in the Site Actions section)
      1. Verify that the three features are active or activate them if necessary.
  4. Now you need to create a new task list to hold some sample data we’ll index:
    1. Select Site Actions » View All Site Content.
    2. Click Create and create a new Tasks list for the site named Project Tasks.
    3. 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.

      Figure 1

      Add tasks

  5. Now you need to create a Search Center sub site, but before doing that, you REALLY need to verify the necessary features are active.
    1. Select Site Actions » Site Settings.
    2. Pick Site collection features under the Site Collection Administration section.
    3. 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
    4. 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).
  6. Next, we need to create a new Search Center sub site in the Lab11 site.
    1. Select Site Actions » New Site.
    2. Select the Search tab.
    3. Select the Enterprise Search Center.
    4. Enter Search Center in the Title field (i.e. first text box).
    5. Enter searchcenter in the URL field (i.e. second text box).
    6. Click the Create button.
  7. 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:
    1. Browse to https://intranet.contoso.com/sites/Lab11/searchcenter. On the new search site, click Site Actions » View All Site Content.
    2. Select the Pages library.
    3. In the Pages library, click Documents » New Document » Page on the ribbon.
    4. Select to create a new (Welcome Page) Search Box and use the following to create the page:
      • Title: Important Tasks
      • URL Name: ImportantTasks.aspx

        Figure 2

        Create new Welcome Page

  8. Next create the search results page for important tasks:
    1. In the Pages library, click Documents » New Document » Page on the ribbon.
    2. Select to create a new (Welcome Page) Search Results and use the following to create the page:
      • Title: Important Tasks
      • URL Name: ImportantTasksResults.aspx

        Figure 3

        Create a new Search results page

  9. Now you need to add a new tab to the https://intranet.contoso.com/sites/Lab11/searchcenter homepage.
    1. On the new search site, click Site Actions » View All Site Content.
    2. Click the Tabsin Search Pages library.

      Figure 4

      View all site content

    3. 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

  10. Click the Save button.
  11. 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.
    1. Browse to https://intranet.contoso.com/sites/Lab11/searchcenter.
    2. Click the Important Tasks tab to jump to the ImportantTasks.aspx page.
    3. Select the Edit button on the Page tab in the ribbon.
    4. 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.
    5. 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

  12. Now check the page in to save your changes. You can find the Check in button on the Page tab.
    Note:
    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.
  13. Open the SharePoint 2010 Central Administration site.
  14. Click Application Management » Manage Service Applications.
  15. On the Manage Service Applications page, click the Search Service Application link. This brings you to the Search Administration page.
  16. Click the Scopes link in the Quick Launch bar under the Queries and Results section.
  17. On the View Scopes page, click New Scope.
  18. On the Create Scope page, enter Important Tasks in the Title field
  19. Enter ImportantTasksResults.aspx for the Target Results Page and click the OK button.

    Figure 6

    Set the results page

  20. 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.
  21. 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

  22. Click the OK button.
  23. With the scope created you now need to start a full crawl.

    1. Click the Content Sources link in the Quick Launch under the Crawling section.
    2. 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

    1. Wait for the full crawl to finish (about 5 minutes).
  24. 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:

    1. Select Search Administration from the top of the Quick Launch.
    2. 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

  25. Your search scope is now ready for use.
    Note:
    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.
  26. 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.
  27. Enter a term and perform a search. This will take you to the ImportantTasksResults.aspx page.
  28. Select Site Actions » Edit Page to place the page in edit mode.
  29. 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.
  30. 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.
  31. 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.).
  32. 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

  33. Click the OK button.
  34. Check In the page.
  35. You should now be able to return results from the task list you created earlier.

    Figure 11

    The search result page

    Note:
    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.