Archive for April, 2013

April 3, 2013

SharePoint 2010 – Search Core Results XSLT Transformation

Suddenly your manger says to you, man, we just wanted to modify the core search results of the SharePoint 2010. So the first step is to add a Search core results web part to your search results page and open the same page in a browser. After that put the page in edit mode and choose edit web part from the Search Core Results Web Part menu.

In the Search Core Results Tool Pane open the Display Properties section and then uncheck “Use Location Visualization” and you can notice that the XSL Editor… button should become active.


Click the “XSL Editor…” button to open the Text Editor dialog.


Replace all the above XSL with the below (or just copy to the clipboard hence you will need the data in future):

<?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="/">
<xmp><xsl:copy-of select="*"/></xmp>

The reason why I did substituted the existing XSLT is to know how the SharePoint renders the output of the search results.

So the core results search of the SharePoint will give you the results in a format as below:

      <title>Your document title</title>
      <author>Mikael Svenson</author>
      <hithighlightedsummary>This is a summary.</hithighlightedsummary>
        <HHTitle>Your document title</HHTitle>
      <imageurl imageurldescription="Web Page">/_layouts/images/html16.png</imageurl>
      <docvector>[procedure overview, 1][links, 0.707107]</docvector>
      <escprojname>00 - UNDEFINED</escprojname>
      <escdeptname>0000 - UNDEFINED</escdeptname>
      <esccategoryname>COMPANY MANAGEMENT SYSTEM</esccategoryname>
      <escsubcategoryname>GOVERNING DOCUMENTS</escsubcategoryname>

When you wanted to modify the search results, then what you have to do is to modify the XSLT part that we copied in one of the steps above. I usually used to do is to copy all those XSLT in to Visual Studio and then modifying the same as needed.


By default the search results would be as below with icons, etc.


After modifying the XSLT the search results would like below:


I was using the OOB search paging web part to get the paging for the search results.


please refer the following links for more detail:

Enterprise Search Core Results XSLT Transformation

How to: View Search Results XML Data

Take Control of Search XSL