Displaying Metadata Properties on Search Results pages (MOSS 2007)

Background
It is possible to display custom metadata beneath each item

found on the search results page. The metadata can be presented in a number of

ways. There is plenty of information on the Internet about how this can be done

using XML and XSL – see http://blogs.catapultsystems.com/matthew/archive/2008/09/01/sharepoint-image-search-part-4.aspx for example.

See also Ref.Inside the Index and Search Engines: Microsoft

Office SharePoint Server 2007 -pages 140-141 book stored in Marlow

office.

On this example we will simply add four metadata items beneath

each item search result.

Instructions

1) Edit the Search Results page and edit the Search Core Results

Web part.

2) Expand the Results Query Options section and click

on the ellipse beside the Selected Columns field. Add extra selected columns to

be used by the Search Core Results. For example you may wish to add the

following lines:

<Column Name=”Brand”/>
<Column

Name=”Market”/>
<Column Name=”Filename”/>
<Column

Name=”TypeImage”/>
<Column Name=”TypeCommunication”/>
<Column

Name=”TypeMarket”/>

if you have previously created a managed metadata property

called ‘Brand’, ‘Market’, ‘Filename’, ‘TypeImage’, ‘TypeCommunication’, and

‘TypeMarket’ (in the SSP) for particular content type columns.

3) Click the XSL Editor … button and search

for <p

class=”srch-Metadata”>

Just

above this line insert a code snippet like the one shown

below:

</xsl:choose>

</div

>

<div class=”srch-Description”>Brand:

<xsl:value-of select=”brand”

/> <br />Market:

<xsl:value-of select=”market”

/> <br />Filename:

<xsl:value-of select=”filename”

/> <br />Type:

<xsl:value-of select=”typeimage” />

<xsl:value-of select=”typecommunication”

/>

<xsl:value-of select=”typemarket” />

<xsl:value-of select=”typeplan” />

</div>

<p

class=”srch-Metadata”>

<span

class=”srch-URL”>

<a

href=”{$url}” id=”{concat(‘CSR_U_’,$id)}” title=”{$url}”

dir=”ltr”>

<xsl:choose>

On

this example we have previously defined Managed Properties in the SSP for Brand,

Market, Filename and four different documents types (Image Type, Communication

Type, Market Type, and Plan Type).

4)

Close the XSL Editor and apply the modification to the Web Part and re-publish

the page.

The

effects of this modification will display the four crawled property values

underneath each item, e.g.

Item

details (as standard)

Brand:

SuperTea

Market:

Australia

Filename:

an-image.jpg

Type:

Press Release

Note:

Each item found will only contain one of the four possible Type

values.