I have posted in the past about how to create a scope display group using the API, but I think new users to Enterprise Search could use some information on the basics of working with scope display groups. The begin with we need to start off by defining what a scope display group is. I’m assuming you know what a scope is already (it’s just a subset of your search index defined by rules you define). A scope display group is simply a grouping of scopes that can be used with the SearchBox web part. When you first, create your search center, you get a search box that looks something like this.
This works great, but I have found that my users like to be able to quickly pick what they are searching for. Out of the box, this will search the entire index and that is just not good enough if users are just trying to find out what Bob Smith’s phone number is. The user doesn’t necessarily want to see every document that Bob wrote.
What I want to do is give the user a preset list of scopes to choose from (i.e.: People, Documents, Sites, etc.). This is where scope display groups come in. A scope display group will allow us to pick which scopes we want to show the user and then we can configure that group for use with the SearchBox web part. To do this, we go to our Site Collection settings and click on the Search Scopes link on the right. Here, you will see a list of all your scopes and what groups they currently belong in. To create a new one, use the New Display Group button. Creating a scope display group is quite easy. Just give it a name and select which scopes you want to include. You can set the order you want the scopes to appear in as well as set the default scope. Here is what my group looks like.
That’s great. We now have a scope display group, but how do we use it? Go to the default page of your search center and edit the page. Then edit the SearchBox web part. The first parameter we need to set is under Scopes called Dropdown Mode.
As you can see this list has a number of parameters. The default value is Do not show scopes dropdown. The other options in the list refer to what the default value of the scopes list is when you see it and whether or not to include contextual scopes (i.e. search this site / list). I usually go with Show, and default to ‘s’ URL parameter or Show, do not include contextual scopes, and default to ‘s’ URL parameter. What it means by default to the ‘s’ URL parameter is that it will default to the value of the scope that was passed in via query string. Remember, search center works by passing everything in via query string (including the scope), so if you do not tell it to default to the ‘s’ parameter, it will use the default value you specified in the scope display group. The default value here doesn’t matter as much here but you will need to make these same changes to the SearchBox web part on the results page as well. That way when users search for additional terms on the results page, it has the same scope.
That is how we tell the SearchBox web part to show a list of scopes, but we have to tell it which group to display as well. Under Miscellaneous, look for the last property called Scope Display Group. Type in the name of your display group, mine is called Search Dropdown and save the changes to the web part and page.
Your search page, should now look something like this.
As you can see the changes you need to make are pretty simple. This is a quick way to give your users more value out of your existing search center. As a reminder, you can create scope display groups using the API as described in my post. The Office Server SDK has some of this info as well but doesn’t go into a ton of detail. That is why I expanded on it in this post. That and I know people like pictures. :) I have to say I am a big fan of the Windows 7 snipping tool. I’ve used it a ton in taking screenshots.
Follow me on twitter.