Experience Management

Where’s the beef of your Expert Search, GSA?

When customizing the XSLT stylesheet for Expert Search, I noticed many places where elements starting with /GSP/ExpertSearchConfig/ were referred. However, I have never found any Google document to explain them.

Where's the beef?

Where’s the beef?


From the usage of those elements in the XSLT stylesheet, they looked like the display layout configuration for Expert Search results.
Given the fact that it’s very easy to obtain general search results in XML (by removing parameter proxystylesheet from the URL), I expected a smooth ride to get that for Expert Search as well. Indeed I was able to get the search results for Expert Search in XML format, but had never seen any elements resembling /GSP/ExpertSearchConfig, even with many combinations of Expert Search related parameters in URLs.
It puzzled and bothered me a lot without being able to see any trace of those elements from expert search results. During quite extensive research on this, I stumbled on Joe Fawcett’s tip provided in Wrox’s forum (Saving XML thru href link using XSLT). It turned out to be just a few lines of XSLT manipulation to locate the elusive beef. Here are the steps to get it:

  • Locate the following section in the XSLT stylesheet for Expert Search from template, render_expert_search_results_:
    <!– Display appropriate view based on presence/absence of results. –>
    <xsl:choose>
    <xsl:when test=”count(/GSP/RES/R) > 0″>
    <ol class=”gsa-exp-results”>
    <xsl:for-each select=”/GSP/RES/R”>
    <li tabindex=”0″>

  • Add a textarea as the following before the line <ol class=…>
         &lt;textarea&gt;
             &lt;xsl:copy-of select="/" /&gt;
         &lt;/textarea&gt;
    
  • Then you would have the following modified section with template render_expert_search_results_:
    <!– Display appropriate view based on presence/absence of results. –>
    <xsl:choose>
    <xsl:when test=”count(/GSP/RES/R) > 0″>
    <textarea>
    <xsl:copy-of select=”/” />
    </textarea>
    <ol class=”gsa-exp-results”>
    <xsl:for-each select=”/GSP/RES/R”>
    <li tabindex=”0″>

  • Save the changes, and run a normal search with Expert Search enabled. You would see the widget view for Expert Search as following:

    Added textarea

    Added textarea

  • Yes, the results of Expert Search in XML format along with /GSP/ExpertSearchConfig element were revealed (I purposely moved to the bottom of the textarea).

  • You can copy the content out from the text area and save it to a XML file, and then view it using a browser. At the bottom of the blog, a portion of a screenshot displays the results of the Expert Search. Isn’t it juicy?

  • If you do not like the eye patch displayed in the widget or detailed view for Expert Search, you can use a hidden textarea as Joe Fawcett’s initial tip. Then you could get the XML data through browser’s source view page for detailed view. For widget view, browser source page did not contain the XML data. You have to enable the develop tool panel to get it.

Empowered with the knowledge of Expert Search configuration in XML, it would be much easier to understand the process about how the expert search results are transformed by the XSLT stylesheet for Expert Search.

Search results with Expert Search configuration info

Search results with Expert Search configuration info


If there is beef, and even you already smell it, sure you will find it.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up
Follow Us
TwitterLinkedinFacebookYoutubeInstagram