How to: |
Magnify provides a simple, easy-to-use interface that is very similar to the one used by the Google Search Appliance. Magnify uses an XSLT style sheet to create the interface by which the user interacts. Developers can use this style sheet to customize various elements on the interface. Also, search results can be enhanced to contain more information, such as date or custom snippet content by configuring fields stored in the index and exposing their values in each search result. The customizations described in the following sections apply whether Magnify is configured with the GSA or a Lucene index.
Any changes made to the Magnify style sheet requires you to restart the application server or issue the &proxyreload=1 request parameter on the browser URL.
By default, the Magnify XSLT style sheet is located in:
\ibi\WebFOCUS80\config\magnify\locale\locale_stylesheet.xslt
where:
Is the subfolder name for each language Magnify supports to provide localized interfaces. The following languages are available:
If your Magnify application is configured with GSA, the Page Layout Helper tool can be used to update certain elements within the style sheet. Please refer to the GSA documentation for more information on using the Page Layout Helper tool. Otherwise, any XSLT editor can be used to update the style sheet.
The \ibi\WebFOCUS80\config\magnify\included_stylesheet.xslt file contains templates for customizing the various components on the Magnify interface and is dynamically included in the Magnify style sheet at run time. Each component can be hidden or displayed and contains customizable attributes such as color, alignment, and size. For example,
Global Style Variables
<xsl:variable name="global_font">Arial,sans-serif</xsl:variable> <xsl:variable name="global_font_size">1em</xsl:variable> <xsl:variable name="global_bg_color">#fff</xsl:variable> <xsl:variable name="global_text_color">#000</xsl:variable> <xsl:variable name="global_link_color">#00c</xsl:variable> <xsl:variable name="global_vlink_color">#551a8b</xsl:variable> <xsl:variable name="global_alink_color">#f00</xsl:variable> <xsl:variable name="global_co_color">#2f2f2f</xsl:variable>
Result Page Components
Search input box:
Search result information:
<xsl:variable name="adv_search_anchor_text">Advanced Search</xsl:variable> <xsl:variable name="show_result_page_help_link">0</xsl:variable> <xsl:variable name="search_help_anchor_text">Search Tips</xsl:variable> <xsl:variable name="show_alerts_link">0</xsl:variable> <xsl:variable name="alerts_anchor_text">Alerts</xsl:variable> <!-- *** search boxes (size in # of characters) *** --> <xsl:variable name="show_top_search_box">1</xsl:variable> <xsl:variable name="show_bottom_search_box">1</xsl:variable> <xsl:variable name="search_box_size">32</xsl:variable>
Result Title and Snippet
<!-- *** result title and snippet *** --> <xsl:variable name="show_res_title">1</xsl:variable> <xsl:variable name="res_title_color">#00c</xsl:variable> <xsl:variable name="res_title_size">1.35em</xsl:variable> <xsl:variable name="res_type_size">.85em</xsl:variable> <xsl:variable name="show_res_snippet">1</xsl:variable> <xsl:variable name="res_snippet_size">1.05em</xsl:variable>
Keyword Match
<!-- *** keyword match (in title or snippet) *** --> <xsl:variable name="res_keyword_color"></xsl:variable> <xsl:variable name="res_keyword_size"></xsl:variable> <xsl:variable name="res_keyword_format">strong</xsl:variable>
Facet Counts
When the facet count setting is set to true, the count displayed in the Dynamic Categorization tree represents all of the indexed content that contains a match. This includes content that is not returned to the result set due to record limit settings. By default, facet count is disabled and only the counts for those items returned in the result set are represented in the Dynamic Categorization tree.
To enable facet counts, change the facetcounts parameter setting to true as follows:
<xsl:if test="not (PARAM[@name='facetcounts'])">
<input type="hidden" name="facetcounts" value="true" />
</xsl:if>
You can expose additional information in the interface to enhance the search results of your Magnify application. To use information stored in the index, the field name and its value must be retrieved and configured in the style sheet. By default, the Magnify style sheet has immediate access to field names and values contained in the XML that is returned by Magnify after a query is submitted. For example,
By default, the Magnify interface enables users to sort by the sentiment score. The sorting option is configured in \ibi\WebFOCUSxx\config\magnify\included_stylesheet.xslt.
<xsl:variable name="show_sort_by_sentiment">1</xsl:variable>
<xsl:variable name="show_sort_by_sentiment">0</xsl:variable>
<input type="hidden" name="spelling" value="false"/>
<input type="hidden" name="spelling" value="true"/>
Note: Blackberry is disabled by default.
span.highlighttitle { font-weight: normal }
span.highlighttitle { font-weight: bold }
or
span.highlighttitle { font-weight: bold; font-size:15px;text-decoration:underline }
<xsl:variable name="show_collections">1</xsl:variable>
<xsl:variable name="show_collections">0</xsl:variable>
<indexes>
<index name="default_collection_old" directory="."/>
</indexes>
<collections> <group name="default_collection" id="default_collection"> <component id="customers" member="customers"/> <component id="employees" member="employees"/> </group> </collections>
<xsl:variable name="logo_url">images/search/magnify/logo.png</xsl:variable>
<xsl:variable name="show_secure_radio">0</xsl:variable>
<xsl:variable name="show_secure_radio">1</xsl:variable>
<p class="s"/> <xsl:choose> <xsl:when test="$type ='snippet'"> <xsl:call-template name="nbsp"/> <div class="ibi_snippet_div"> <xsl:variable name="br_html"><br></xsl:variable>
<!--p class="s"--><xsl:choose>
<xsl:when test="$type ='snippet'">
<xsl:call-template name="nbsp"/>
<div class="ibi_snippet_div">
<xsl:variable name="br_html"><br></xsl:variable>
<!-- ********************************************************************** My global page header/footer (can be customized) ********************************************************************** --> <xsl:template name="my_page_header"> <!-- *** add your xhtml here - suggest styling via #ph (header) or .phf (header/footer) --> </xsl:template> <xsl:template name="my_page_footer"> <!-- *** add your xhtml here - suggest styling via #pf (footer) or .phf (header/footer) --> </xsl:template>
<xsl:template name="customhomepage"> <xsl:text disable-output-escaping="yes"> <Encoded HTML> </xsl:text> </xsl:template>
Note: All HTML syntax must be encoded.
<!-- ********************************************************************** Search result page header (can be customized): logo and search box ********************************************************************** --> <xsl:template name="result_page_header"> <xsl:if test="/GSP/PARAM[@name='usernametodisplay']/@value != ''"> <div style="text-align:right"> <xsl:value-of select="$user"/> <xsl:call-template name="nbsp"/> <xsl:value-of select="/GSP/PARAM[@name='usernametodisplay']/@value"/> </div> </xsl:if> <xsl:if test="$show_logo != '0'"> <xsl:call-template name="logo"/> </xsl:if> <xsl:if test="$media != 'handheld'"> <xsl:if test="$show_skip_links != '0'"> <xsl:call-template name="skip_links"/> </xsl:if> <xsl:if test="$show_top_search_box != '0'"> <xsl:call-template name="search_box"> <xsl:with-param name="type" select="'std_top'"/> </xsl:call-template> </xsl:if> </xsl:if> <xsl:if test="/GSP/CT"> <p id="sw"><xsl:call-template name="stopwords"/></p> </xsl:if> </xsl:template>
<!-- **********************************************************************
Search result page header (can be customized): logo and search box
********************************************************************** -->
<xsl:template name="result_page_header">
<xsl:if test="/GSP/PARAM[@name='usernametodisplay']/@value != ''">
<div style="text-align:right"> <xsl:value-of select="$user"/>
<xsl:call-template name="nbsp"/>
<xsl:value-of select="/GSP/PARAM[@name='usernametodisplay']/@value"/>
</div>
</xsl:if>
<xsl:if test="$show_logo != '0'">
<xsl:call-template name="logo"/>
</xsl:if>
<xsl:if test="$media != 'handheld'">
<xsl:if test="$show_skip_links != '0'">
<xsl:call-template name="skip_links"/>
</xsl:if>
<xsl:if test="$show_top_search_box != '0'">
<xsl:call-template name="search_box">
<xsl:with-param name="type" select="'std_top'"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
<xsl:if test="/GSP/Q =''">
<xsl:call-template name="customhomepage"/></p>
</xsl:if> <xsl:if test="/GSP/CT">
<p id="sw"><xsl:call-template name="stopwords"/></p>
</xsl:if>
</xsl:template>
WebFOCUS |