1

I would like to edit how the search results render. The default behaviour is to start with a link to the document (or the dispform.aspx of a list item). I was able to change the url value for specific types of documents.

What I now want to do is to replace the title of the result link to not be taken from the "title" or "name" field, but from a custom column I have.

I have already added the column to be crawled and also added it in the fetched properties of the web part.

Now I have to edit the xslt, but I have very little understanding of the language and can't find where the 'title' of the link is stored.

I am using search server express and sharepoint foundation. Thanks in advance!

1 Answer 1

1

I know it's been a long time, but I found answer to my question using this simple technique posted for a different question.

I just needed to replace from the default xsl these lines:

  <xsl:otherwise>
    <a id="{concat($currentId,'_Title')}">
      <xsl:attribute name="href">
        <xsl:value-of  select="$url"/>
      </xsl:attribute>
      <xsl:attribute name="title">
        <xsl:value-of select="title"/>
      </xsl:attribute>
    <xsl:choose>
     <xsl:when test="hithighlightedproperties/HHTitle[. != '']">
      <xsl:call-template name="HitHighlighting">
       <xsl:with-param name="hh" select="hithighlightedproperties/HHTitle" /> 
      </xsl:call-template>   
     </xsl:when>
     <xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise> 
    </xsl:choose>
    </a>
  </xsl:otherwise>

with this:

  <a href="{$url}" id="{concat('CSR_',$id)}" title="{$url}" target="_blank">
   <xsl:value-of select="xxxxx"/>
  </a>

Where xxxxx is the managed property (in my case 'displayname'). Now the titles of the search results don't get highlighted, but everything else works OK.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.