|
Recently I have been involved in a solution where I needed to customize my Search Core Results webpart. In short; I had to remove Created By and replace it with a piece of metadata called alias. Seems like a trivial task – all you need to do is to adjust XSL of the *Search Core Results *and remove or replace Author field, but there is a catch. First, open your Search Core Results XSL: <!-- Main body template. Sets the Results view (Relevance or date) options --> this section denotes a start of the XSL responsible for rendering the body of the results. In here you will find all of the components that put together a search result. In my case I found and replaced the document author retrieval implementation with the following: <xsl:call-template name=”DisplayAuthors”> <xsl:with-param name=”alias” select=”alias” /> </xsl:call-template> After the XSL was saved, this worked well but I was still getting the actual CreatedBy in my search results. The created by information turned out to be coming from the property calledhithighlightedsummary If you take a look at the definition of this property in your search service application: http://[central you will notice that hithighlightedsummary doesn`t have any of the crawled properties defined explicitly. In fact, this property is a dynamic summary that has a collection of highlighted word pieces that best describe the result and give user the text around the keywords they were searching. Among those calculated pieces of metadata we have CreatedBy and any other relevant metadata. This means that no matter how much you customize your XSL – you will still receive some parts of the metadata as part of the hithighlightedsummary. One compromise is to remove this property from your XSL and replace it with a item description, body, or any other metadata that is relevant in your case. Here is the template and selector that call hithighlightedsummary from the XSL: <xsl:when test=”hithighlightedsummary\[. \!= ''\]“> <xsl:call-template name=”HitHighlighting”> <xsl:with-param name=”hh” select=”hithighlightedsummary” /> </xsl:call-template> </xsl:when> <xsl:when test=”hithighlightedsummary\[. \!= ''\]“> <xsl:call-template name=”HitHighlighting”> <xsl:with-param name=”hh” select=”hithighlightedsummary” /> </xsl:call-template> </xsl:when> To create your new custom summary field you would define the managed property that will incorporate relevant crawled properties in here: http://[central Don`t forget to include your newly created managed property in a list of fetched columns within your Search Core Results: Good luck! |
Removing metadata from SharePoint 2010 search results

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. Hosted generously by CustomWare