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 when Magnify is configured with a Lucene index.
Any changes made to the Magnify style sheet requires you to restart the application server.
By default, the Magnify XSLT style sheet is located in:
\ibi\WebFOCUS82\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:
The \ibi\WebFOCUS82\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, as shown in the following 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="show_result_page_help_link">0</xsl:variable> <xsl:variable name="show_alerts_link">0</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>
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 Magnify returns. 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 }
In addition to editing the included_stylesheet.xslt file to adjust the appearance of a search result title, you can add styling instructions to the procedure before it is fed into Magnify Search and converted into a search index. In this file, you can edit the SEARCHTITLE/A1000 code line to make search result titles appear in italics or in bold.
Note: You cannot add search result title styling options to both the included_stylesheet.xslt file and the procedure at the same time. Choose one file that will contain these styling conditions.
The following example shows the SEARCHTITLE/A1000 code line edited to make search result titles display as bold.
SEARCHTITLE/A1000='<b>' || CAR | ' (' || COUNTRY || ')</b>';
The following example shows the SEARCHTITLE/A1000 code line edited to make search result titles display as italic
SEARCHTITLE/A1000='<i>' || CAR | ' (' || COUNTRY || ')</i>';
<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/> <xsl:choose> <xsl:when test="$type ='snippet'"> <xsl:call-template name="nbsp"/> <div> <xsl:variable name="br_html"><br></xsl:variable>
<!--p--><xsl:choose>
<xsl:when test="$type ='snippet'">
<xsl:call-template name="nbsp"/>
<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 | |
Feedback |