1,685 articles and 12,533 comments as of Thursday, September 2nd, 2010

Wednesday, July 2, 2008

EndUserSharePoint.com: Creating a Team Site Search Center

Search Center

Author: Chris Quick
WSS Development

In my last two posts, we discussed managed properties and search scopes. These are fundamental building blocks to assist us in building a search center for our team sites, so if you haven’t read those it might be a good idea to go back and refresh yourself on those topics.

This week, we are going to take the foundation that we’ve built to put together a search center for our team site. In order to complete the actions for this article, site collection administration rights may be required. The easiest way to determine if you have site collection administration rights is to click on Site Actions > Site Settings. The last column should say Site Collection Administration.

Search Center Defined

MOSS ships with two different search center templates. These templates allow you to define a central location to perform searches for content in your SharePoint environment. They can be configured to handle a wide variety of searches using rules and managed properties. Our goal is to provide this functionality for a large team site.

Getting the Team Site Ready

Before begin creating the search center, there are some site collection features that must first be enabled so the necessary templates, web parts and libraries will be available to the site. Depending on your environment and governance structure, you may have some of these features already enabled on your site. You may also want to make sure that enabling these features do not violate any governance structures in place within your organization prior to making these changes.

To make use of the search center template, you must turn on the publishing infrastructure on search web parts site collection features. To do this, click on Site Actions > Site Settings and then locate Site Collection Features and click on it. Ensure that Office SharePoint Server Publishing Infrastructure and Office SharePoint Server Search Web Parts are active. To activate a feature, you simply click on Activate.

Team Site Search Center - Figure 01

When you activate the publishing infrastructure, there will be some new libraries created on the top level site: Site Collection Documents, Site Collection Images and Style Library. You will also notice a couple of new lists created as well: Content and Structure Reports and Reusable Content.

Once these features have been turned on, we need to create a display group for any scopes we are going to use for our team site. To do this, click on Site Actions > Site Settings and locate Search Scopes in the Site Collection Administration menu. From the search scopes page, click on New Display Group to create a new display group. Give it a recognizable title and an optional description. Make sure the scopes that you wish to include are checked. For my scope, I want to include the EAS Team Site and All Sites scopes. You can adjust the position of the scopes by changing the dropdowns next to them. When you are satisfied with your settings, click OK.

Team Search Center - Figure 02

When you return to the view scopes screen, your scope should now be included in the appropriate display group.

Team Site Search Center - Figure 03

Create a New Search Center Site

Now that we have our site configured, we can create a new site that will be our new search center for the site. Click on Site Actions > Create. Locate Sites and Workspaces in the list of options and click on it. This will bring up the screen to provide information for the new site. Provide the information needed for the site. For the template, click on the Enterprise tab and choose Search Center. When you have completed the settings for the site, click on Create. You should now have a basic search center.

Team Site Search Center - Figure 04

Configure the New Search Center

Now that a search center has been created for the site, we need to make some changes so the site will search only the content that you desire. We are going to set the search center to use our display group so we can provide a targeted search to the scopes we have defined for our site. Begin by choosing Site Actions > Edit Page to change into the editing mode. Locate the search box web part and choose Edit > Modify Shared Web Part.

Team Site Search Center - Figure 05

So that we can expose multiple scopes to our search center, opt to turn on the Scopes Dropdown. This is done by expanding the Scopes Dropdown Area and setting the dropdown mode to Show Scopes Dropdown.

Team Site Search Center - Figure 06

Move down to the Miscellaneous Area and expand it. We need to set the Scope display group at the bottom of the area to our display group we created earlier. In my case, I need to set it to Team Site Scopes.

Team Site Search Center - Figure 07

Click OK and you should now see your scopes available in a dropdown preceding the search term box.

Team Site Search Center - Figure 08

Exit edit mode now and execute a search query. You will now be on the results page. If you execute the same query on this page, you will get results from all sites in SharePoint. This is not our desired goal, so we need to make the same configuration changes to the search box on this page as well. Your page should end up looking something like the following:

Team Site Search Center - Figure 09

Summary: Team Site Search Center

You now have a search center for your site that will focus searches to include content from inside your site. You can define more scopes as needed and place them in the same display group that this search center is using to allow your team members to search for other types of content.

Chris QuickChris Quick
WSS Development

View all entries in this series: ChrisQuick-EndUserSharePoint.com: Search»
 

Please Join the Discussion

12 Responses to “EndUserSharePoint.com: Creating a Team Site Search Center”
  1. Dean says:

    Can this technique be used to search other site collections?

  2. Chris Quick says:

    Dean,

    I’m sorry for the delayed response. Yes, you can use this to search other site collections that SharePoint is currently indexing by providing the URL to the site collection. However, if the search indexer is not aware of the resource, you will not return any results. You may have to check with your SharePoint Administrators to see if the resource you want to include as a scope is currently being indexed by SharePoint.

    Chris

  3. Christophe says:

    Hi Chris,

    I make the same as you for defining my search scope. But I realize the scope is used only if the scope dropdown is enable or visible. Is it right?

    Christophe

  4. Chris Quick says:

    Christophe,

    There is a way to limit your results to a specific scope, even if you don’t display the scope. You will need to edit the results page and modify the Search Core Results webpart. In the web part properties, expand the miscellaneous column. You will see a place you can provide your scope. Type the name of your scope and then save all of your changes. This will set the default scope for your results.

    Personally, I prefer to show a list of scopes so my site visitors can quickly choose the content area of interest.

    Chris

  5. John Wells says:

    Chris,
    I followed your instructions and double-checked that I was doing so. Everything looked good
    –scope created, display group created, new group appeared on the search dropdown. Http folder to search appears to be correct.

    Problem is that the search for a known value does not return anything, even though I know the word is there in a document, and the document does come up using the all site search. So it is being indexed, but cant be found within that scope.

    Any hints on where to look next?

  6. Chris Quick says:

    John,

    When you view the scopes, does the scope show any items? If the scope continues to show 0 items in the index, nothing will be returned.

    Check out the rules as well. Each rule should also have an approximate count of the items. If this is 0, double check for typographical errors. Let me know if this helps!

    Chris

  7. John Wells says:

    thanks for the quick response!
    I am heading out soon, so may not look at this again until monday but will definitely look then.

    Looking at the Properties page for the display group I see a reasonable value in the rules area for the item count on Include line, but the Total is reported as zero.

    The View Scopes page line listing shows the columns Items as zero for the display group. It does not have a check box in the shared column, but I dont think your example does either.

    In the Edit Scope settings form for the new group I have all three items checked (Search Dropdown, Advanced Search, IWS6 DDEV) and checked the button to use the default search results page.

    BTW even though I can see and modify these pages I am not a full admin on the site. I have designer privileges, but am not admin. Could that be part of the problem?

  8. Chris Quick says:

    John,

    Have you had a chance to follow up on this?

    If you have access to work with scopes, you should have the rights you need to complete the actions in this article. I’m guessing it might be a simple configuration error on the scope.

    Let me know what you find out!

    Chris

  9. John Wells says:

    Hi Chris,
    We must be on different time zones.
    I will be heading out in 10 minutes (4:30 eastern)
    To make sure it wasn’t typos, I went back through and did the following:
    Created a new scope called testJW,
    added rule to point to my site root folder
    Deleted old display group
    Created a new display group called testJWb
    create a new site TestSrch and exit webpage editor
    — so now I am ready to try my search site
    The display for the search shows the display group in the pull-down
    but no records display and item count is still zero
    Same thing happens when I open a site, then choose the group from the search pull-down options
    Testing the search using the regular site options works fine.
    I just don’t know what else to tell you.
    Could this be related to the fact that we dont have site collections defined for this site?

    I could create a document with screenshots if that would help but I dont know how to get it to you.

  10. Mike says:

    Is there a way to modify the default search center to include custom scopes or must a new search center always be created?

  11. Anagha says:

    Hi,
    Thanks for the great article? We have two web applications and I am trying to configure it go that both you the same Search Center site to display results. I ahve included links from both the web applications in the scope definition. However I see results only form one web application. Am I wrong in assuming that the search should work across web applications? Thanks for your help!

Trackbacks

Check out what others are saying about this post...
  1. [...] a previous article in the Exploiting or Being Exploited By SharePoint Search series , we discussed how to create a simple Search Center that will allow you to search your team site for information. We have also discussed managed [...]




Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!