Tuesday, November 16, 2010

Search Results Customization RAW XML

You are trying to customizing the Search Core Results Web Part to display a custom column in Search Results. You have modifed the XSLT as expected, but dont get the desired column in the results. You need to verify that the column values are returned by Search Engine (Crawl + Index + Query) as expected. After all, Search Core Results Web Part is only applying XSLT transformation to the input (Search Results it recieves in XML format). If Column values are not returned by Search Engine, the Search Results Web part cant display the same in Search Results.

How do you verify the RAW XML. Well, you can apply the following XSLT to view the source XML (Dont forget to copy and backup the original XSLT to a notepad file, you will need the same to revert back).

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xmp><xsl:copy-of select="*"/></xmp>

If the required column is in RAW XML but not displayed in results, the problem is in your XSLT.
If the required column is missing in RAW XML, the problem is elsewhere. You need to validate if you have created Managed/MetaData Properties, Done a full or incremental crawl, modified the Search Core Results Web Part Fetched Properties and added the managed property to SelectedColumns.

No comments: