Quick Hits: Using a custom property with hit highlighting

So you have a managed property with SummaryType set to Dynamic and you want to use that in the FAST Search Center but your results show up with <c0> tags instead of highlighted terms?  In the Core Results XSLT, replace the following:

<xsl:when test="hithighlightedsummary[. != '']">
     <xsl:call-template name="HitHighlighting">
         <xsl:with-param name="hh" select="hithighlightedsummary" />

with a reference to your managed property ('redactedbody' in the example below):

<xsl:when test="redactedbody[. != '']">
<xsl:variable name="hh_fin">
<xsl:call-template name="replace-string">
<xsl:with-param name="text" select="redactedbody" />
<xsl:with-param name="replace" select="'c0'" />
<xsl:with-param name="with" select="'strong'" />
<xsl:value-of select="$hh_fin" disable-output-escaping="yes"/>

and then add this implementation of replace-string:

<xsl:template name="replace-string">
     <xsl:param name="text"/>
     <xsl:param name="replace"/>
     <xsl:param name="with"/>
     <xsl:when test="contains($text,$replace)">
         <xsl:value-of select="substring-before($text,$replace)"/>
         <xsl:value-of select="$with"/>
         <xsl:call-template name="replace-string">
             <xsl:with-param name="text" select="substring-after($text,$replace)"/>
             <xsl:with-param name="replace" select="$replace"/>
             <xsl:with-param name="with" select="$with"/>
         <xsl:value-of select="$text"/>


Comments (0)

Skip to main content