Managing the Search Experience in Microsoft SharePoint 2010

  • 6/24/2010

Creating and Managing Search Scopes

A search scope provides a mechanism to group items logically within the index based on common elements. They are used to target a query to only a precompiled portion or slice of the corpus to provide a more efficient query and more relevant results.

Essentially, there are two types of scopes. Authored scopes are created by search or site collection administrators. Contextual scopes are created automatically and presented as This Site or This List. The This And Related Sites scope available in team sites is just a collection of contextual scopes.

To begin to manage search scopes at the search application level, click the Scopes link in the Queries And Results group of the Quick Launch area of the Search Administration page for your search application. This opens the View Scopes page as shown in Figure 9-17.

The People and All Sites scopes were created automatically, but they are authored scopes and can be managed. Because contextual scopes cannot be managed, they are not displayed on the View Scopes page. However, all scopes authored at the service application level or at associated site collections are stored in the search service database and are displayed on this page.

Scopes created at the service application level are known as shared scopes and are available for use in any site collection subscribing to the search service application. Scopes created at a site collection are available for use only in that site collection unless they are copied as a shared scope at the service application level. In Figure 9-17, the Team One scope, which was created at the team1 site collection, presents the same context menu as scopes created at the search service application level. However, that scope can be copied only as a shared scope at this level and must be managed at the original site collection location.

Figure 9-17

Figure 9-17 The View Scopes page.

To create a new scope, click the New Scope link, which is shown in Figure 9-17. The Create Scope page, as illustrated in Figure 9-18, presents the same options as the Edit Scope page. Complete the following steps before clicking OK:

  1. Enter a name, in the Title field, that is unique across your enterprise and that clearly defines the content for users. In Figure 9-18, we used Contracts.

  2. Enter a description that defines the usage for search administrators. This field is blank by default.

  3. Ignore the Last Modified By field, which cannot be edited.

  4. Change the Target Results Page settings if you have a custom results page for this scope.

Figure 9-18

Figure 9-18 The Create Scope page.

Because the new scope has no rules applied, it appears on the View Scopes page with a status of Empty – Add Rules, as shown in Figure 9-19. A scope is not functional until you add rules to define the common elements that delineate the boundaries of the scope. The Add Rules link shown in Figure 9-19 is available only for adding the first rule.

Figure 9-19

Figure 9-19 The View Scopes page with the new scope added.

When you click the Add Rules link, the Add Scope Rule page opens, as shown in Figure 9-20.

Figure 9-20

Figure 9-20 Add Scope Rule page for the Web Address type.

A scope rule comprises a rule type and any definition of the rule type required, plus the behavior of the rule.

Available rule types are these:

  • Web Address. This type can be any location addressable with a URL in a browser, including Web sites, file shares, public folders, and so on. These addresses can be defined as specific locations called folders, any locations on a specific host, or even all locations in a specific domain.

  • Property Query. This type can be any managed property enabled for use in a search scope. The definition section of the Add Scope Rule page changes to that shown in Figure 9-21 for property query rules. Select the managed property from the drop-down list, and enter the value for that property that will be used in the rule. In Figure 9-21, we chose ContentType, which by default is not enabled for use in scopes, and then entered Contract as the value.

    Figure 9-21

    Figure 9-21 The Add Scope Rule page with the Property Query option selected.

  • Content Source. This rule type presents a drop-down list of content sources for the search application. Be careful when choosing this option because changes to the content source could be made without regard to their impact on the scope rules.

  • All Content. This type has no additional configuration options.

Scopes can have multiple rules. The Behavior configuration of the rule shown in Figure 9-20 defines how this rule will be applied in compiling the scope. The definitions are straightforward. Both the Include and Require options include content meeting the rule definition, but if the scope has multiple rules all items included must meet the condition of the Require behavior rules.

After creating the first rule, you must click the scope name in the View Scopes page to open the Scope Properties And Rules page shown in Figure 9-22. From this page, you can manage the scope rules and edit the scope properties.

Figure 9-22

Figure 9-22 Scope Properties And Rules page.

Note in Figure 9-22 that the new scope Update Status is New Scope - Ready After Next Update (Starts In 9 Minutes) and the Item Count Total shows “(not yet compiled).” Items in the index are matched to their scope with a compilation process that is separate from the crawl and indexing process. This process is a scheduled timer job that runs every 15 minutes by default, but it can be initiated manually from the search service application management page when scopes need updating, as shown in Figure 9-23.

Figure 9-23

Figure 9-23 Scope update information from the Search Management page.

This process can also be changed to manual by clicking the Automatically Scheduled link to open the Specify Update Schedule dialog box shown in Figure 9-24 and then selecting the On Demand Updates Only option. The timer job schedule cannot be managed from Central Administration.

Figure 9-24

Figure 9-24 Specify Update Schedule dialog box for the scope compilation process.