In this post I am going to demonstrate how to setup SharePoint 2007 to use Content Types in your Search Scope. Why? Because there isn’t much documentation on the web about this and it took me some time to figure out.
First, you need to make sure that custom search scopes are allowed. To do this, go to the Site Settings for your top level site. Under the Site Collection Administration section, choose Search Settings. Here, make sure “Use Custom scopes” is selected.

Second, we want to make sure that we can use Content Types in a Search Scope (this was the key piece that I was missing when setting this up). To do this, you need to go to your Shared Services site (SSP) and go to Search Settings. Then we want to go to the Metadata Property Mappings in the Crawl Settings section. Here are all of the Managed Properties that SharePoint knows about. Find ContentType and click on it. At the very bottom there is a check box to all this property to be used in scopes.

Once you have done this, you need to crawl the site in order for SharePoint to index the Content Types. You can do this from the Search Settings page inside the SSP.
Next, we want to create our search scope. There are two ways to do this. You can do go through the SSP or you can do it from your SharePoint site. For this example, I am going to use the SharePoint site. Go to the Site Settings for your SharePoint site. Under the Site Collection Administration section choose Search Scopes.

Go ahead and choose New Scope. For this example, I am going to create a scope centered around the Document content type.

One thing to note, I selected the “Search Dropdown” box. I did this so that it will show up in the drop down box that is at the top of the page.
Hit ok and it will take you back to the Scopes page. On the line that says Documents, it has a link to “Add rules”. Let’s click on that to add the rules for the scope.

The key thing to note here is the “Add property restrictions” dropdown. We can select ContentType here because we allowed the managed property to be used in scopes earlier in the process. From here, hit ok. It will take you back to the scopes page. At this point you either need to wait for the scopes to update (done every 15 minutes) or you can go the SSP and under Search Settings select Update Scopes to force it to update.
Now we can search for items that are of the Content Type “Document” from the drop down.

You can add more rules to make it more restrictive or to exclude items as well. I hope this helps you out as I could have used something like this yesterday!
Technorati Tags: MOSS, SharePoint 2007, Content Types, Search Scopes
Powered by ScribeFire.
Filed under: IT by phyler
No Comments »