Introducing the Content Search Web Part

Source: Microsoft SharePoint Blog

If you ever dealt with publishing scenarios like creating an intranet portal or a knowledge management solution back in SharePoint 2007 and 2010 days, there is a good chance that you were using the Content Query Web Part. Content Query is great for showing dynamic content based on a set of criteria that you’ve set.  So if you wanted to show a list of news articles on the intranet homepage, or to roll up a list of sales reports on your knowledge center, Content Query was the way to do it.

There was one catch though: If you ever wanted to show items that were not in the same site collection, you were out of luck. The scope of the Content Query Web Part was (and still is) limited to the site collection that the Web Part is placed in.

In SharePoint 2013, FAST Search and SharePoint Search fused together and got deeply integrated into SharePoint. As part of that change, we added a new tool for publishing content for your intranet or Internet site that knows no site-collection boundaries. This tool is the Content Search Web Part.

Content Search can show anything that’s in the search index including content across site collections, and even content that comes from outside of SharePoint as long as it was crawled and placed in the search index. If search crawls it, you can display it, no matter where the content lives—provided the user viewing the page has permissions to see the item in question. Plus, thanks to the analytics capabilities that are built into SharePoint 2013, it can also show recommendations and popular items based on usage patterns.

If this sounds like something you want to try out, you can find Content Search in your SharePoint farms by going to the Web Part adder, and choosing the Content Rollup category. (Content Search is not available on Office 365 right now, but we are working on enabling it in the future.)

Figure 1. Two Content Search Web Parts from different contexts: on the left an intranet site that displays some PowerPoint files from another site collection, on the right the Contoso Electronics site that displays some items from the product catalog


At a very high level, using Content Search is easy by following these two steps:

  1. Choose the items to show (formulate a search query that will return those items as results).
  2. Format the items the way you want (use Display Templates to customize how items look).

Following is a little more detail about these two steps.

Choosing the items to show

The Content Search Web Part boasts a full-screen query builder that has several preconfigured queries to get you started, and a panel for previewing the results to enable you to tweak your query. It’s fully integrated with the new search concepts of SharePoint 2013, like Results Sources and Query Rules, and can use these to get to results. It also has an advanced mode: basically, an enlarged search box where you can write any query using Keyword Query (KQL) syntax, which you can then try out by using the preview panel.

Figure 2. Query builder with tools on the left and preview of results on the right


Content Search also supports a rich set of dynamic values (also called query variables) to be used in queries such as today’s date, the name of the current user, any field from the current page, or a custom property from the current web’s property bag. Query Builder and dynamic values each deserve blog posts of their own, but for now, you can try out the following query variables in your queries if you want to explore some of the possibilities:

{Today-7}: The date for a week ago, great for “what’s new this week” queries. {User.Name}: The name of the current user. Great for surfacing content for the user who is viewing the page. Also works for any property, including custom properties from the current user’s profile. {Page.MyCustomTextField}: Gets the value of a field that you added to the content type you’re using on the page. {Site.URL}: Gets the current site’s URL, or any custom property. Also works for SiteCollection. {Term}: The current term from managed navigation. For more information, see the blog post Getting friendly with FURLs.

Formatting the items the way you want: Display templates

One of the main pain points we kept hearing from customers was about how irritating it is to use XSL to format the output of a Content Query Web Part. XSL is a relatively obscure web technology and it has a reputation for making most seasoned folks go scratch their heads about the syntax whenever they try to do something a little unusual while formatting the results.

In SharePoint 2013, there is a new way to format items shown in Content Search Web Parts using HTML and JavaScript instead of XSL: Display templates.

Display templates make it significantly easier to:

  • Specify what managed properties to retrieve from search.
  • Manipulate values   of the retrieved managed properties in JavaScript, as needed.
  • Display the values   in HTML in the browser.
Figure 3. Same search results displayed using three different sets of display templates in each of the columns


Display templates are located in the master page gallery of your site collection. There are several display templates that come pre-installed in a folder named Display Templates for your convenience, so feel free to browse around that folder if you’d like to get a feel for them. The best way to create a new display template is to copy one of the existing ones, and change its properties and content. Note that you should always deal with the .html files in those folders; .js files are auto-generated by SharePoint whenever you modify an .html file of the same name.

Display templates also deserve another blog post to do that topic any justice, so let me wrap this section up here to keep this post short and sweet.


I hope this gave you a taste of what the Content Search Web Part can do for you in your SharePoint deployments. Be sure to look for future posts that will go into more detail about some of the concepts introduced here.

SharePoint 2010: Standalone installation, but with full sql version

For development and testing i usually install the standalone version of SharePoint 2010.

I start with installing win2008R2, then i install sql2008r2, then i install the SharePoint pre-requisites, and when i start installing SharePoint i always realize, i don’t have the option to use the installed sql server. Standalone ALWAYS installs sql express and uses this as the database server.

So i end up with 2 sql instllations.

an alternative is to install a farm, based on local accounts, but that’s not always what i want.

For those who want that, take a look at this article :

So, when i wanted to setup a development environment again i wanted to start with SQL installation. However, this time i remembered i don’t need it.

But what if i still want to use it instead of the express version.

that’s when an idea popped up. What would happen if i installed sql as an instance with the name …….. SHAREPOINT.

The same instance name that SharePoint uses for the express installation.

I installed sql2008R2 as an instance with the name SHAREPOINT and then installed SharePoint.

And guess what …. it used the SHAREPOINT instance i created as database for the SharePoint installation.

Voila. SharePoint standalone installation on the full SQL version.




How to quickly change the central administration port (2010)

Sometimes, after installing, you find out that the chosen port number is not the best or preferred number. In my case, an application was installed using the same portnumber as central administration.

This can ofcourse be initiated, by the fact that the final portnumber was not yet known at installation time, OR, you have sharepoint 2010 installed as a standalone installation (you are not allowed to choose the admin port in a standalone administration)

So you want to change the portnumber.

Here is how it is done.
Open the sharepoint 2010 management shell ( yep, powershell to the rescue)
type in: Set-SPCentralAdministration
You will be asked the new portnumber.
Or type in : Set-SPCentralAdministration -Port

It will take some time, but then the portnumber of central administration is changed. Done it several times now, sofar, no issues.

The version of SharePoint Server 2010 for Internet Sites that is downloaded and installed before May 25, 2010 does not have all product features enabled, or it runs with reduced functionality

If you installed Microsoft SharePoint Server 2010 For Internet Sites Enterprise, and then you tried to activate the product by using the enterprise key before May 25, 2010, you encounter the following symptoms:

  • The following Enterprise features are not available, or the features have reduced functionality:
    • Access Services
    • InfoPath Forms Services
    • Chart Web Parts
    • Excel Services
    • PerformancePoint Services
    • Visio Services

To verify that you are encountering this issue, consider the following scenarios:

  • One of the following GUIDs exists in the output of the (Get-SPFarm).Products cmdlet:
    • 1F230F82-E3BA-4053-9B6D-E8F061A933FC
    • F48AC5F3-0E33-44D8-A6A9-A629355F3F0C
  • The following registry subkey contains one of the previous GUIDs:
    HKEY_LOCAL_MACHINESOFTWAREMicrosoftShared ToolsWeb Server Extensions14.0WSSInstalledProducts{90140000-110D-0000-1000-0000000FF1CE}

For more info and a solution look here :

5 times internal memory equals minimal free disk space

Yesterday we installed SharePoint 2010 on a new server.

Since it’s a pilot to check out new functionality and to see if we can accomplish what we want, we started out with a “moderate” server.

After installing, i went to the central administration and saw i got a critical issue.

Nice to be informed about this , but i didn’t expect it. I had already done the installation twice, to get acquainted with the new version. So , i was unpleasantly surprised.

You are offered a hyperlink to show the critical issue.

It was: Drives are at risk of running out of free space

How was this possible. So i decided to check out the free disk space. it was 29 Gb.

So that could never be the issue. But, after reading the complete error message i found out it was an issue.

The complete error message was (click on the issue to see the complete message):

Available drive space is less than five times the value of physical memory. This is dangerous because it does not provide enough room for a full memory dump with continued operation. It also could cause problems with the Virtual Memory swap file:

And that was correct because it had 6Gb memory installed.

5 * 6 Gb = 30 Gb > 29 GB.

So remember : the amount of memory installed is reflected on the amount of needed free disk space.



SharePoint designer 2010

How odd.

Today i wanted to isntall the SharePoint designer 2010.  So i went to the several Micsosoft websites (Office en SharePoint) to look for the download.

Nowhere to find !

even when searching the Microsoft site , i only found references to the beta versions. But, when searching for SharePoint Designer specific in the downloads section: the finally popped up.

For all you out there also searching for it, here are the links

Before i forget, i worked with the new version some hours now, and it’s really nice to see that it’s much better then the 2007 version!