April 2007 - Posts

SharePoint 2007 - How to Rollup Content from multiple Site Collections (1 way)

I am currently designing & building a sizeable intranet for a global shipping company.  They will have multiple site collections with multiple subsites and lots of lists and libraries scattered throughout the site structure.  One of the site collections is the "parent" site collection to all the others and will function as the entry point for most of the users.

We had a need to rollup content from all of the different site collections and sites to the "parent" site.  The first thing that crossed my mind was the Content Query Web Part.  After playing around with it for about 10 seconds, and then doing a little bit of research to make sure, it was clear that this web part was limited to only rolling up content from a single site collection (see below).  Also, it requires that you activate the publishing feature.  Although the publishing feature may be useful, it creates a lot of management overhead if you are not using it so I needed an alternate solution.

Well, after some thought, SharePoint Search came to the rescue.

Here is my scenario.  On the "parent" site collection there is a Sales subsite.  Throughout the various regional site collections and their respective local or country specific subsites, there may be many Sales related libraries.  These scattered libraries may contain various types of Sales documents including PowerPoint presentations, Excel workbooks, Word documents or Adobe PDF's.  My challenge was to determine how to identify all of this material.  Although there are alternative (and undoubtedly better) ways to do what I did, the general idea holds true and the methodology would be the same.

In each of the site collections I added a yes/no site column called IsSalesMaterial and defaulted its value to "yes".  I then added this site column to all of the libraries that contained sales material.  Now all sales material would be flagged and more importantly, be searchable using this column.  I also added some content to these libraries so that I would get some results.

I flipped over to Shared Services Administration to make a couple of necessary changes.  The first change was to perform a full crawl so that my new property would be visible to SharePoint Search.  I need to make it a managed property and allow it to be used in scopes.

After performing a full crawl of all of your content (I am assuming that the content that you want to surface using this method is already included in an existing content source) navigate to Crawl Setting and click on Metadata property mappings.

Click on New Managed Property.

Name the yes/no property SalesMaterial and add a mapping to ows_IsSalesMaterial(Yes/No).  Be sure to check Allow this property to be used in scopes so that we will be able to use this property in a custom scope.

After saving the property, find it in the list and click on the appropriate mapping in the Mappings column.  If you wanted this property to be included in your index automatically, check the Include values for this property in the search index checkbox.  We do not, since we are only using it for a custom scope.  Checking this checkbox on too many properties can degrade performance, so check wisely!

Now we need to create a custom scope.  Create a new scope named Sales Material.  Add a single rule to include all items that have the SalesMaterial property set to Yes.  Update your scopes.

I then went to the front end web site of my "parent" site collection.  I added a Search Core Results web part to the page and made the following changes to return to me all sales related PowerPoint presentations.

  1. Under Results Display/Views change Default Results View to Modified Date.
  2. Under Results Query Options, change Cross-Web Part query ID to Query 2.
  3. Under Fixed Keyword Query, change Fixed Keyword Query to FileExtension:pptx FileExtension:ppt
  4. Under Miscellaneous, change Scope to Sales Material.
  5. Under Appearance, change the Title to Sales Presentations and change the Chrome Type to Title.

You should now see all of the PowerPoint presentations retrieved from the Sales Material scope.  You can now add another Search Core Results web part to your page to return all Excel Workbooks or any other type of query you want to fix.  Just be sure to set the Cross-Web Part query ID to another value to group all your search web parts together.  For example if you add a Search Paging web part below this Search Core Results web part, be sure to set its Cross-Web Part query ID to the same value as the Search Core Results web part that it will be paging.

Happy Searching!