Get XML data from the CoreResultsWebPart

Jan 13, 2012 at 12:00 AM

We often want to debug the XSLT code that we have written for our CoreResultsWebPart, this post will help you to extract the data from the CoreResultsWebPart and later which we can apply to debug our custom XSLT written for the CoreResultsWebPart.


1. You need to have the Administrator privileges
2. Basic understanding of creating web applications and running the FAST search.


First thing you need to do is get the Basic Fast Search Center site up and running. Below i have mentioned the brief steps.
1. Create Web application with classic mode authentication.
2. Create a root site collection with "Fast Search Center" template.
3. Open the root site collection and try to search, as long as it displays the result you are fine :)

First Step : Edit the page and replace the default XSL with our custom XSL

As you Site is up and running, search for any term and go to the results page. Edit the page from Site Actions -> Edit Page
Search for the Search Core Results web part on the page and edit the web part. In the search core results editor pane, go to the Core Results->Display properties.
Uncheck the "Use Location Visualization" option, by default it would be checked.
Note: It means that site has to use the columns and XSL defined at the federated location level. Which is shared by all the search sites in the farm. When we uncheck this option we can define our own XSL format. More information on this topic can be found here
On unchecking this option the area under Fetched Properties and XSL editor will be enabled.
Fetched Properties are the columns that you want to be retrieved from the FAST search database. The columns mentioned within these properties will only be fetched.
Now click on the XSL editor button, it will open the dialog displaying the XSL used for the CoreResultsWebpart. Replace the default XSLT with the following code. Don't forget to take the backup of default code in case you want to revert back to original code :)


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


 Click on Ok and save the page. 

Second Step : View the Search Results Web part XML data

Right-click the page zone that contains the Search Results Web Part that you want to view the search results XML data for, and then click View Source on the pop-up menu. This opens a page in Notepad that contains the HTML source. 

Search for the string “<All_Results>”. This is the opening tag for the section that contains the full search results set for the Web Part you modified.


Found this article by Dhaval Shah valuable? Help by Sharing ...

  • Click on the banners at the top of article or in the right panel to visit my blog's sponsors. They are all hand-picked and are selected based on providing great products and services to the SharePoint community.
  • I’d be very grateful if you’d help it spread by Sharing. Below, you should find links to sharing this article on your favorite social media sites.
Related Posts by Dhaval Shah blog comments powered by Disqus