2010, Development Blog, SharePoint
XML Structure for FAST Search Core Results Web part
If you’re an XSLT guru, you need to know the XML structure you’re working with. Getting into the guts of SharePoint isn’t always a walk in the park, but Microsoft has made it easy to view the XML structure in FAST.
You basically have 2 options:
Option 1
- Navigate to your Search Center’s Result page (you can do a search to get there quickly)
- Place the page in Edit Mode (Site Actions > Edit Page)
- Open the Web Part Properties for the Search Core Results web part. (little arrow on the right, Edit Web Part)
- Under the Display Properties heading, uncheck the Use Location Visualization checkbox (this enables the XSL Editor button)
- Hit XSL Editor…
- Highlight everything in the popup and save it in a text file (you need to keep this as a starting point for XSLT customization anyway)
- Replace it with the following piece of XSLT:
1 2 3 4 5 6 7 | <?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> </xsl:template> </xsl:stylesheet> |
- Hit OK on the Web Part Properties, and save the page.
You should see something similar to this structure (I replaced the data with ‘….’ so it’s easier to view)):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | <All_Results> <Result> <id>....</id> <workid></workid> <rank>....</rank> <title>....</title> <author>....</author> <size>....</size> <path>....</path> <description>....</description> <write>....</write> <sitename>....</sitename> <collapsingstatus></collapsingstatus> <hithighlightedsummary>.... <c0>....</c0> ....<ddd /></hithighlightedsummary> <hithighlightedproperties> <HHTitle>.... <c0>....</c0> ....</HHTitle> <HHUrl>....</HHUrl> </hithighlightedproperties> <imageurl imageurldescription="Item icon">....</imageurl> <contentclass>....</contentclass> <isdocument>....</isdocument> <picturethumbnailurl>....</picturethumbnailurl> <url>....</url> <serverredirectedurl></serverredirectedurl> <fileextension>....</fileextension> <spsiteurl>....</spsiteurl> <docvector>....</docvector> <fcocount>....</fcocount> <fcoid>....</fcoid> <pictureheight></pictureheight> <picturewidth></picturewidth> </Result> <TotalResults>...</TotalResults> <NumberOfResults>...</NumberOfResults> </All_Results> |
This is a pretty simple hierarchy, but if you don’t know what fields are called, you’re still stabbing in the dark with your XSL Transform. Knowing the structure and what fields are called is half the battle.
Here’s a link to the full article: http://msdn.microsoft.com/en-us/library/ms546985.aspx
Option 2
You can view Fetched Properties (under the Display Properties heading) – just click into the field, CTRL-A (select all), and paste it into an editor. This is easier to read if you’re purely interested in what FAST Search is pulling in, but less helpful in that you do not get sample data, or the nested hierarchy. It should look something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | <Columns> <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="Url"/> <Column Name="ServerRedirectedUrl"/> <Column Name="FileExtension"/> <Column Name="SpSiteUrl"/> <Column Name="docvector"/> <Column Name="fcocount"/> <Column Name="fcoid"/> <Column Name="PictureHeight"/> <Column Name="PictureWidth"/> </Columns> |
About Author
Comments are closed