Skip to content
October 19, 2011 / red1s

Modifying SharePoint 2010 Standard Search Results

Recently I had to do a complete overhaul of the SharePoint 2010 search results page. Actually it was part of an overall search solution based on SharePoint foundations search engine (I know right, why not FAST) anyhow it had to be done.

We used a combination of XSLT trickery B-D and Metadata Property mappings combined with scopes and a few workflows the objective was achieved (more on the overall solution later)

For now though I’ll just get into how the search results page was updated to output what was required and in essence modify the search results listing page (which for most people seems to be a bit complex)

The tutorial consists of two components:

Metadata properties

XSL Styling

The first Segment of this tutorial will be setting the managed metadata property to output required column info-

I added the required pre created columns as metadata properties from Central Admin

From Central Administration:


Open up metadata properties from the search service applications link:


Create a new managed property:


You’ll need to provide a property name:


Then add a mapping:for the crawled property, which has been crawled and is of the following type: (Text, Integer ,Decimal ,Date and Time ,Yes/No) as other types won’t be picked up


Once you’ve done that make sure you see it in the Mapping to crawled properties:


Then select ‘Use in scopes’ for it to appear in the scopes and ‘Add managed property to the custom result set retrieved on each query’

Once you’ve completed this then update the crawl and complete a full crawl: (Do it twice just in case)




This is the second section which is the XSLT portion of the tutorial

Go into your search results page – or the page that has your core results webpart:


You’ll need to untick -> Use Location Visualization (Which more info is explained in another one of my blog posts)


QUICK NOTE: ensure that all your xsl variables  are lower case – took me a while to figure that 1 out Smile with tongue out

And make sure to add the newly created metadata property to ‘Fetched Properties’ in the following form: (note my new property at the end)



<Column Name="WorkId"/> <Column Name="Rank"/> <Column Name="Title"/> <Column Name="Author"/> <Column Name="Size"/> <Column Name="Path"/> <Column Name="Description"/> <Column Name="Write"/> <Column Name="SiteName"/> <Column Name="CollapsingStatus"/> <Column Name="HitHighlightedSummary"/> <Column Name="HitHighlightedProperties"/> <Column Name="ContentClass"/> <Column Name="IsDocument"/> <Column Name="PictureThumbnailURL"/> <Column Name="PopularSocialTags"/> <Column Name="PictureWidth"/> <Column Name="PictureHeight"/> <Column Name="DatePictureTaken"/> <Column Name="ServerRedirectedURL"/>

<Column Name="ProviderAddress"/>


Once its been added here you’ll need to begin working with your XSLT code which can be accessed by hitting the following button:


Firstly you’ll probably need to see what type of data is coming out of it and if your newly inserted metadata properties are pulling data out successfully.

A good test for this is to template the XSL content in the editor with the following XSLT info:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">

<textarea rows="20" cols="100">

<xsl:copy-of select="*"/>




Which outputs the searched content to the page: (not pretty but usable) so you should get something like the below:


Once you’ve noticed that your elements are pulling the correct data out you’d need to then modify the XSLT and require a bit of knowledge around XSLLT, I recommend the following sites for this:

XSL Syntax Basics –

This helped me (If then) –—if-then-else.aspx and

Finally how to format search results: (which is very useful to allow you to understand the terms used in the search core results page and their usage )

For instance:


Anyway once you know the above I used the following link: to restyle my search results page:

This developer has created a styled table with elements that can be used in combination with the previous metadata elements used to create a table of output results with data formatted from the search results

After completing the formatting and addition of the required columns my table now look s like this


Once you are aware of the XSL formatting and other elements of the page you can do a whole host of things to style and work on the outputted results.

Such as ordering the results, adding removing columns and joining content to form complex variable strings based on data returned from the search results:

The following code is a segment for ordering result set info based on the providersequence

<xsl:sort select="providersequence" order="ascending" />

<xsl:sort select="productgroupstring" order="ascending" />

Formatting data rows:

<td class="ms-vb">

<xsl:value-of select="providersequence" />


<td class="ms-vb">

<xsl:value-of select="productgroupstring" />


And that’s it , hope you find this insightful and be sure to leave feedback or comments if you have any queries or the like 😉


SharePoint 2010 video on search results modification-

SharePoint Meta data property management –

Sample: Search Core Results Webpart XSLT  –


Leave a Comment
  1. shaik / Oct 23 2012 1:51 pm

    i want custom results page along with refinement can do this.


  1. SharePoint 2010 – Adding multiple search core results to one page with different result sets « red1'space

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: