Wednesday, April 7, 2010

SharePoint 2010 Search Core Result webpart raw output

Scenario:
This is for my reference as I always need to see the raw output of search results before I can format it.

Solution:
Here's the XSLT to get RAW output as well as Sample output

XSL for RAW output:

<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>
</xsl:template>
</xsl:stylesheet>
SP2010 Output :
<All_Results>
<Result>
<id>1</id>
<workid>2338</workid>
<rank>72021170</rank>
<title>Documents</title>
<author></author>
<size>0</size>
<url>http://sp2010/Documents/Forms/AllItems.aspx</url>
<urlEncoded>http%3A%2F%2Fsp2010%2FDocuments%2FForms%2FAllItems%2Easpx</urlEncoded>
<description>This system library was created by the Publishing feature to store documents that are used on pages in this site.</description>
<write>4/7/2010</write>
<sitename>http://sp2010</sitename>
<collapsingstatus>0</collapsingstatus>
<hithighlightedsummary>This system library was created by the Publishing feature to store documents that are used on pages in this site. <ddd /> <c0>ScriptGenerator</c0> <ddd /> </hithighlightedsummary>
<hithighlightedproperties>
<HHTitle>Documents</HHTitle>
<HHUrl>http://sp2010/Documents/Forms/AllItems.aspx</HHUrl>
</hithighlightedproperties>
<contentclass>STS_List_DocumentLibrary</contentclass>
<isdocument>False</isdocument>
<picturethumbnailurl></picturethumbnailurl>
<popularsocialtags />
<picturewidth>0</picturewidth>
<pictureheight>0</pictureheight>
<datepicturetaken></datepicturetaken>
<serverredirectedurl></serverredirectedurl>
<ows_metadatafacetinfo></ows_metadatafacetinfo>
<fileextension>ASPX</fileextension>
<imageurl imageurldescription="Result of type: document">/_layouts/images/STS_List_DocumentLibrary16.gif</imageurl>
</Result>
</All_Results>
MOSS 2007 Output :
<All_Results> 
<Result>
<id>1</id>
<workid>194189</workid>
<rank>1000</rank>
<title>Some Title</title>
<author>Last, First</author>
<size>64436</size>
<url>http://yourserver/yourfile</url>
<urlEncoded>http%3A%2F%2Fyourserver%2Fyourfile</urlEncoded> <description></description>
<write>1/7/2010</write> <sitename>http://yourserver/yoursite</sitename>
<collapsingstatus>0</collapsingstatus> <hithighlightedsummary>Summary</hithighlightedsummary>
<hithighlightedproperties>
<HHTitle>Title</HHTitle>
<HHUrl>http://yourserver/yoursite</HHUrl>
</hithighlightedproperties>
<contentclass>STS_ListItem_PictureLibrary</contentclass>
<isdocument>0</isdocument>
<picturethumbnailurl>/_layouts/images/icgen.gif</picturethumbnailurl>
<imageurl imageurldescription="Result of type: document">/_layouts/images/STS_ListItem16.gif</imageurl>
</Result>
</All_Results>

3 comments:

Prashanth August 6, 2010 at 5:20 AM  

Thanks man. This helped a lot to create my xslt.

Koen Zomers December 6, 2010 at 11:13 AM  

Easy though very useful :) Thanks!