SharePoint was designed to serve as a repository for user data (among other things). The downside is that it's not always easy to pull a particular piece of data from that vast vault of information.
As more and more data accumulates, a SharePoint search becomes an increasingly complex task. Fortunately, the task can be made simpler by creating scopes that enable custom searches in SharePoint.
Even if they don't realize it, workers who conduct a SharePoint search are already using search scopes. SharePoint 2010, in fact, has three search scopes enabled by default: All Sites, This Site and People.
Search scopes define which subset of the data will be searched. By default, SharePoint searches All Sites, but users can just as easily do a People search or search on a specific SharePoint site. In addition, an administrator has the ability to create custom search scopes that help users further target their searches.
Creating a scope for custom searches
More on SharePoint and search:
Official blog of the Microsoft SharePoint Product Group
Configuring and optimizing SharePoint 2010 search
Microsoft makes it relatively easy to create custom search scopes in SharePoint 2010. If, for example, you wanted to create a search scope at the service application level, you would begin by opening the Central Administration console. When the console opens, locate the Application Management section and click on Manage Service Applications.
At this point, SharePoint will display the Manage Service Applications page. Look through the list that's presented until you locate Search Service Application. Click on that, find the Queries and Results section on the following page and then click on Scopes. The View Scopes page (see Figure A) displays the People and All Sites scopes.
You can create a custom scope by clicking on the New Scope link, which causes SharePoint to display the Create Scope page (see Figure B). The first steps to creating a custom scope are to provide a name and a description of the scope that you are creating. You must also specify whether you want to send the search results to the default SharePoint Search Results page or if you want to use a different page. In most cases, using the default Search Results page is fine. Click OK to create the scope.
To make that search scope useful, you need to customize it. Click the down arrow to the right of the scope (see Figure C) and then choose the Edit Properties and Rules option from the shortcut menu.
Search scopes are based on a collection of rules. You can create a rule by clicking on the New Rule link. It is also possible to create multiple rules for a single search scope. As you can see in Figure D, search scopes can be based on the following:
- a Web address (which is used to query a specific site or page, server or item such as a list)
- a Property Query (which is a metadata query that identifies specific metadata such as a document author or file extension)
- a content source (which can be used to index a local SharePoint site)
Using scopes for SharePoint search
In SharePoint 2007, the search box contained a dropdown list that let you select the search scope you wanted to use.
This option is disabled by default in SharePoint 2010. To enable the search dropdown, click on Site Actions and then click Site Settings. Locate the Site Collection Administration section and then click on Search Settings.
When the Search Settings page appears, choose the Show and Default to Contextual Scopes option from the Search Site Dropdown Mode section (see Figure E). You will also need to set the Site Collection Search Center to Enable Custom Scopes. Click OK to save your changes.
This will give users a dropdown list allowing them to select the scope of their searches. If your custom search scope does not show up in the list, go to the Site Settings page and click on the Search Scopes link in the Site Collection Administration section. The Search Scopes page gives you a bit more control over how custom search scopes are used.
Although using scopes for custom searches in SharePoint makes it easier for users to locate data, it is important to remember that there can be too much of a good thing. Creating an excessive number of custom search scopes tends to complicate the search process rather than making it easier.