This post will outline how to configure search in MOSS 2007 so that search results do not crawl other site collections and how to use Search Scopes to implement this.
If you search on the web, you will find numerous articles on general MOSS 2007 Search configuration. So, I am not going to repeat that here. My goal is to help you understand Search Scope in MOSS 2007 and restrict crawl results against other site collections.
- SSP (Shared Services Provider) was configured in Central Administration using standard settings.
- Web application is created on Port 80: http://dev1
- Root site collection (named "Dev Portal") is created on dev1 using publishing site template.
- Using Central administration a managed path with name "finance" is created.
- Site collection (named "Finance Portal") is created on the managed path (http://dev1/finance) using publishing site template.
If you search on Dev Portal, the results returned should be confined only to Dev Portal site collection and not the site collection present under Dev Portal(i.e. no results from Finance Portal) and vice versa.
I searched for a keyword "scott" on my Dev Portal and this is the result I got
As you can see, I have 2 listings (one from the root site collection — Dev Portal and the other from site collection created on the managed path — Finance Portal)
Now, let me perform the same search on the Finance Portal
Ok, so now let us go about creating search scope and confining the search results only to the respective site collection.
1. Navigate to Site Actions — Site settings — Modify all site settings in the Dev Portal
2. Select "Search Scopes" under "Site Collection Administration"
3. In the window that displays, select New Scope
4. Type in the name of the scope as shown and check the Search Dropdown & Advanced Search check boxes. These are the standard display groups.
5. Once the new scope is created, add new rules to the scope. The first rule is shown in the screen shot below. This rule ensures that finance site collection is excluded from the search performed in the Dev Portal
6. Add one more rule and in this rule, add the root site collection and set the Behavior to "Require" as shown in the screen shot. When you are done with setting the rules, the compilation will take place as per the schedule. Let the compilation finish.
7. Click on the "Search Dropdown" option on the View scopes screen and make the changes shown in the screen shot. I have unchecked "All sites" and "People". You can keep them based on your requirement.
Repeat the same settings for "Advanced Search"
8. Now we are done with the Search scopes screen. Perform any type of search on Dev Portal so that the search results page is display. Click on Site Actions — Edit Page and select the "Search core results" web part.
Select edit — Modify shared web part and under Miscellaneous section, set the scope to "Dev Portal Search Scope". Re-call that this is the name of the new search scope we had created.
Click "Ok", check-in, publish, approve the page.
9. Now, go back to Dev Portal home page and perform the search again for the keyword "scott" and you will see that only search result is retrieved and it is confined to only the "Dev Portal" site collection.
10. You can repeat the same steps for "Finance Portal" site collection with the exception of Step 5.
Hope this posting helped you understand the concepts of Search Scopes and how to utilize them to confine search results to specific site collections.