I've recently found that when a user searches for a phrase in double quotes, the results page is highlighting individual words from within the phrase that may not actually match the full quoted phrase. This can make it difficult for the user to decide which document in the results list is the one they're looking for.

SharePoint 2007 does appear to be correctly filtering the results based on the complete phrase, it's just the highlighting that's off. For that matter, the text blurb that's shown in the results is also often not useful since it's based on the highlighted word.

Does anyone have any suggestions on how to fix this?

1 Answer 1


The highlighted words in the search results comes from the .xslt used in the search results transformer. You can see this .xslt when you edit the properties of the search results web part.

I imagine it's possible to do what you're asking but you may want to temporarily switch the search results over to raw XML and then you'll see how the search-terms are passed to the results transform which then applies a template to create the highlighting effect.

The xslt to output raw XML search results would look like:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:template match="/">
            <xsl:copy-of select="*" />
    <!-- End of Stylesheet -->

I realize that this is more of a tip than an answer but i hope it helps you discern why you're getting the highlighting that you're seeing.

  • Thanks for the tip but I don't see anything in the XML results that will help. There's a <hithighlightedsummary> element for each result that shows the same summary text as the results page, with highlights indicated inline by wrapping the highlighted text in a <c0> element. Commented Jul 28, 2010 at 18:25
  • FYI line 4 of your XSLT should read "<xsl:template match="/">. Commented Jul 28, 2010 at 18:26

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.