Today’s post will be the start of a series of posts that will show how to leverage the power of SharePoint 2010’s search to address limitation of cross site collection content rollup. Many times I get requests to roll up all tasks in SharePoint assigned to a particular user. This is fine if all of those tasks are assigned within the same site collection. When it is all the same site collection meaning we are only looking to roll up content from sub sites then the Content Query WebPart (CQWP) is a great option and probably my favorite WebPart that SharePoint offers. However this becomes a problem when we assign tasks in multiple site collections. The data view webpart or XSLT webparts can connect to these other locations and roll up the content nicely but you will need to know the locations that the tasks are in and you will have to update these list views whenever a new task list, or document library (whatever content you are looking for) is created. Being that the SharePoint 2010 My Site defaults to being a separate site collection I see more times than not content is in various different site collections and the need comes up every so often to show this disjointed content in one location.

Through this series I will go over how to roll up all tasks assigned to a particular user regardless of where the task resides. Leveraging the power of the search engine allows us to ignore the typical boundaries of the site collection for content roll up and in fact it will even eliminate the boundary of the SharePoint farm. I will walk through how to create the custom search scope, how to configure the search core results WebPart, and the custom code and XSLT changes to make it user specific and a custom look and feel so it doesn’t look like search results. So without any more boring intro and setup lets get started.

The first thing we need to do is configure the custom search scope. You may have done this for a number of different things already, for those that haven’t here are the steps.

Open up Central Administration, go to Manage Service Applications, click on your Search Service Application and then click on manage on the ribbon. This takes you to the search administration page.

On the left hand side under Queries and Results click on scopes

SharePoint 2010 Central Administration

Then click on New Scope, create a title (I called mine My Tasks), fill in the description and then you can use the default search results page for now.

How to Create New Search Scope SharePoint

You are taken back to the scopes page and you can see the new custom scope that we just created. Now we need to add the rules that make the scope work, so click on add rules.

Custom Search Scope SharePoint

First we want to add all of the content sources that you would like to find tasks on. This allows you to not include tasks on a certain site if you would like, it also it want allows you to get tasks from another farm. You will only be able to configure this for sources that you have indexing configured. So if you are looking to find tasks on another farm you have to setup that connection to have it indexed first. We won’t go through that right now. For this example we will just use all local SharePoint sites. So select the content sources radial button, in content source field select local SharePoint sites, make sure that the Include option is selected and click OK.

SharePoint 2010 Task Rollup

Now Hover over the new custom search scope and click “edit properties and rules” so that we can add an additional rule.

Click on New Rule

Search Scope Rule Configuration

Then select property query, in the property restrictions field select content type and the = field type in “task” without the quotes, make sure Include is selected and click OK.

Advanced Search scope rule settings

If you don’t see ContentType as an option when creating this rule, go to Search Service Application –> Metadata Properties and then edit the managed property and set All this property to be used in scopes. Then repeat the steps above.

After changing crawled or managed properties a full crawl of the content source is required for those changes to take effect. So whatever content sources you added, make sure to kick off a full crawl of those sources.

That takes care of creating the custom search scope. Next time we will go over adding the search core results WebPart and configuring that to use the new custom search scope. Then we will finish the series up with some XSLT styling to make it look more list like than search result. I hope this helps you out and gets you started and as always I look forward to hearing your comments.