How to get a richer result set in MOSS

To present additional information in the search result will often give a better user experience. The search results web parts can easily be  modified to include meta data stored on e.g documents in MOSS.

The meta data is stored via Content Types and the search engine is mapping into these meta data using Managed Properties.

Central Administrator is used to do meta data property mapping:clip_image002

The managed properties can then be used in the result set.

Go to the search center, perform a search and then edit the search result page.

Result Query Option

Add the managed properties, you would like to expose in the result list, in the search result web part’s result query option property:

<root xmlns:xsi="">
<Column Name="WorkId"/>
<Column Name="Rank"/>
<Column Name="Title"/>
    <Column Name="Saksbehandler"/>
<Column Name="Dokumenttittel"/>
<Column Name="Mottaksdato"/>
<Column Name="Arkivkode"/>
<Column Name="AvsenderMottaker"/>
<Column Name="Dokumenttype"/>
<Column Name="Dokumentdato"/>
<Column Name="Selskap"/>

<Column Name="Filename"/>
<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"/>

Search Core Result

The search result web part’s result xsl also has to be modified to present the managed properties to the user. Open the xsl and scroll down to the section that starts with the following:

<!-- This template is called for each result -->
<xsl:template match="Result">

Add your code within the section, (example):

<xsl:call-template name="DisplayReadOnly">
<xsl:with-param name="str" select="avsendermottaker" />
<xsl:with-param name="metadata">avsendermottaker</xsl:with-param>
<xsl:with-param name="label">Avsender/Mottaker</xsl:with-param>

<xsl:call-template name="DisplayReadOnly">
<xsl:with-param name="str" select="mottaksdato" />
<xsl:with-param name="metadata">mottaksdato</xsl:with-param>
<xsl:with-param name="label">Mottaksdato</xsl:with-param>


The Result

Following two steps…

  1. Adding Managed Properties
  2. Modifying Search Result Web Part (two xsl properties)

…will expose more information about the document to the end users: