So let’s take a look at SharePoint search scopes. You might be asking yourself what scopes are and why should you care. Actually, scopes is one of those search features that you can live without and be fine, but once you find about them you will see the light.
You will need SharePoint server Standard or Enterprise. Sorry it is not in SharePoint Foundation. I created this demo in CloudShare.com.
To explain what search scopes are I’m going to jump into this by showing you an example of a search scope.
If you don’t see the scopes drop down in you site collection go to site settings>search settings. In the ‘site collection search dropdown mode’ select the appropriate setting. In my case I selected ‘show scopes dropdown’.
Looking at the graphic we can see we can search for ‘SearchTerm’ in a specific context. In this example I’m searching for ‘SearchTerm’ in ‘All Sites’ context. Alternatively, I can search for ‘Jim Bob’ in a ‘People’ search context.
This can be done at the site collection level or the farm level. I’m going to show how you can do it at site collection level.
Now that we have defined what a scope is let’s take a look at creating a scope. This requires you to be at least a site collection owner level. If you are proceed to site actions>site settings>search scopes. You should see the following.
I’m going to add a query scope that will narrow my search to Word documents.
Select ‘New Scope’. Fill in the required title and any other option’s you may need. In my case I’m going to call it ‘Word Documents’ and press OK. Now, you have a scope but it unused and it has no rules. The rules tell the scope how it should limit its search parameters.
Select ‘Add rules’ for our new shiny new scope. This brings up the rules for this particular scope. Selecting different rule types gives you different trailing options. In my case I’m creating a ‘property query’. At this point I can define how my scope query should be defined. Looking at the property restrictions options we have a ton of options to use.
I’m going to select FileExtension and value of ‘docx’. Next, you notice I can have the scope behavior include, require, or exclude whatever the above rule type. I’m going to use the include behavior.
At this point we have a basic scope with a single rule, but it is unused.
This means that the scope is there, but it won’t show up in any scope dropdown
First, let’s select the rule and this give us the properties of this scope. You’ll notice that I can make some basic revisions including the ability to add even more rules to the same scope.
Let’s select the ‘Change scope settings’ option. In ‘Display Groups’ lets select ‘search dropdown’. Go back to the site settings> search scopes page.
And if we go to the portal page…
Here I’m going to search for ‘someFile’ that has the extension of ‘docx’.
In the previous windows you may have noted that the ‘shared’ checkbox is missing. ( we will give you the Eagle-eye bonus) This is because we created at the site collection level. You can take the same steps from the SharePoint search service application and it will be shared across all site collections. If created form the search service application it then can be used, or not, in each site collection.
One thing to keep in mind is that an incremental search crawl has to happen so that the scope can be properly populated.
Bonus tip: don’t go crazy creating scopes. Make them relevant to your users, if not they won’t use them. Meaning you did all this great working for nothing. Think of a few choice scopes that are easily understood versus 5+ search scopes that take more time than they are worth.