You can use content types to establish search scopes. In SharePoint Server 2007, search scopes allow you to define and group a specific type, or source, of content to more granularly configure and categorize your search. For example, you could create a search scope in your site collection which includes content associated with the Document content type. Then, if you run a search query against that search scope, all content based on the content type of Document will be returned in the search results.
Search scopes can be created either through the Search Settings configuration page in Shared Services for an entire Web application or through the Search Scopes configuration on the root site of a site collection. For example, if you'd created a content type, Teamstatus, for Team Status reports and then wanted the ability to be able to search explicitly on Team Status reports for team members, you could establish a search scope for that content type. To create a search scope on the root site (Litware) of the Litware site collection and base the search scope on the Teamstatus content type, do the following:
You must be an administrator on the server to perform this action.
Open the Site Settings page for the root site and click the Search Settings link under Site Collection Administration.
Ensure that the Enable Custom Scopes And Search Center Features checkbox is selected as shown in Figure 15-29.
Go back to the Site Settings page and click the Search Scopes link under Site Collection Administration to open the View Scopes page.
From the toolbar on the View Scopes page, click New Scope.
On the Create Scope page, shown in Figure 15-30, type a name for the search scope in the Title box, in this case Forms, along with a description.
In the Display Groups section of the New Scope page, select both the Search Dropdown and Advanced Search check boxes.
Selecting Search Dropdown includes the custom search scope name in the search drop-down list, as shown in Figure 15-31.
Selecting the Advanced Search option includes the custom search scope name on the Advanced Search page as an additional scope that you can use in your search queries, as shown in Figure 15-32, in this case Forms.
Click OK to return to the View Scopes page.
Back on the View Scopes page, locate the Forms search scope and, from the Forms contextual drop-down menu, select Edit Properties and Rules.
On the subsequent Scope Properties and Rules page, click on New Rule.
On the Add Scope Rule page, in the Scope Rule Type section, select the Property Query option.
In the Property Query section under the Add Property Restrictions list, select ContentType, as shown in Figure 15-33.
In the Equal To field, type the content type you want to run a search against and then click OK. In this case, type Teamstatus so that you can search for Team Status reports entered by employees.
SharePoint updates the new search scope and index content for that scope in the next scheduled crawl update.
Type the query on the Advanced Search page to run the search against the new Forms search scope.
You can also run the search from the drop-down search box on the home page of the Litware site.
On the Advanced Search page, the new content type search scope, Forms, is included, and you can add search criteria against this new search scope.
In the All Of These Words box, type the name Christine.
Under Narrow The Search, Only The Scope(s), select the Forms search scope check box. Click Search.
The search returns two records, both of which are Team Status reports. One report has been submitted by Christine Koch; the other report has been submitted where Christine Koch is the Manager. (See Figure 15-34.)
Figure 15-29: Enabling custom search scopes on a site
Figure 15-30: Create Scope configuration page
Figure 15-31: Search Dropdown including content type search scope
Figure 15-32: Advanced Search page including a content type search scope
Figure 15-33: Select content type for a query parameter
Figure 15-34: Search results based on a content type search scope
This example demonstrated how you can run search queries against content types. The Teamstatus content type was used to create a custom search scope and run a query on any forms associated with that content type. This is just one example of how you can use content types to enhance your search capabilities.