Home > Search, Sharepoint > Highlight custom Property in Sharepoint Search Result

Highlight custom Property in Sharepoint Search Result

 

image

Highlighting  keyword search at search result happened automatically for properties that by default existed at search result.

But when we need to applied it for custom property shown at custom search result, we must do these following steps:

1. Add HitHighLight=”true” inside tag for custom property that we want to highlight, at Fetched Properties, like this:

image

2. Write this in XSL Search Result for that property :

<xsl:if test="string-length(mycustomproperty) &gt; 0">
<xsl:choose>
<xsl:when test="hithighlightedproperties/mycustomproperty[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/mycustomproperty" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="mycustomproperty" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
 
Categories: Search, Sharepoint Tags: ,
  1. No comments yet.
  1. September 2, 2015 at 6:08 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: