Basic Search – Display Different Columns

So another minor post about search. Last post
I explained the use of metadata property mappings, and their strength allowing you
to show more information without a lot of changes. However I forgot to mention the
fact that u can actually show them pretty easy in your existing search results.

Assuming you created your Metadata properties
you can go to your search page, the XSLT of your resultswebpart to:

<?xmlversion="1.0"encoding="UTF-8"?>

      <xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

            <xsl:outputmethod="xml"version="1.0"encoding="UTF-8"indent="yes"/>

                  <xsl:templatematch="/">

                        <xmp><xsl:copy-ofselect="*"/></xmp>

                  </xsl:template>

</xsl:stylesheet>

(More info on that on a previous
post
on this blog) .

Next step will be a minor change in Results
Query Options, here you will have a property for Selected Columns, editing it will
show you the normal columns used in your search results before the end </Columns>
you can easily add a new <Column Name=”YourMetaDataProperty” />. By using the
above XLST you can save the page search, and check real-time whether your column exists
and contains information.

You might have to play with capitalization
a bit, ‘cause sometimes the column name differs from the metadata property.

Leave a Reply