WCM Search Module
Configuration
The WCM Search Module can be used to create a basic Search function on keywords in items stored in a WCM environment. Queries may be composed of keywords combined with "AND/OR" operators to create a more specific query.
Ensure the following tag appears in the <Module> section of...
/PortalServer/wcm/config/connect.cfg<AptrixSearch class=com.aptrix.search.AptrixSearchModule remoteAccess=true autoLoad=false />Also ensure that <AptrixSearch /> is included in the Dependent Modules section of the "Connect" Module configuration:
If you are accessing a search page using an IP address instead of the server name, you will also need to change the "ProcessUnknownHosts" parameter to true:<DependentModules> <Syndication /> <Default /> <AptrixSearch /> </DependentModules><BusinessLogic> <ProcessUnknownHosts value=true /> <Hosts> <hostname value=true /> </Hosts>The Portal Server must be stopped and re-started for these changes to take effect.
Search settings are defined in...
$ILWWCM_HOME/config/aptrixsearch.propertiesEdit..
/portalserver/shared/app/config/services/LocalizerService.properties...and set...
Create a Search Query Page
The following example can be used within Presentation Templates, or as a Rich text Component that can then be referenced within a Presentation Template.
<H2>Search Query</H2> <FORM METHOD="GET" ACTION="/wps/wcm/connect"> <p> <INPUT TYPE="HIDDEN" NAME="MOD" VALUE="AptrixSearch"> <INPUT TYPE="TEXT" NAME="QUERY" SIZE="56"> <INPUT TYPE="SUBMIT" VALUE="Search"> </p> <p><input type="radio" name="SEARCHTYPE" value="AND" checked="yes"> <p><input type="radio" name="SEARCHTYPE" value="OR">OR</input></p> </FORM>The results of the search query are displayed in the following HTML pages.
Create Result and No-Result Pages
Result and No-Result pages must be created. The following examples can be edited to a desired format. These can be stored as HTML files located in your WAR directory.../AppServer/installedApps/[node-name]/wcm.ear/ilwwcm.war/htmlSample Result Page
<HTML> <BODY> <H1>Search results</H1> <P>Returned <FIELD NAME="RESULTSETSIZE"> results</P> <TABLE BORDER="1" WIDTH="90"> <TR><TH>Title</TH></TR> <RESULTSET> <LOOP> <TR> <TD> <A HREF="<FIELD NAME=URL>"><FIELD NAME="TITLE"></FIELD></A> <BR>(<FIELDNAME="URL">)</TD> </TR> </LOOP> </RESULTSET></TABLE> </BODY> </HTML>Sample No-Result Page (Optional)
<HTML> <BODY> <H1>Search results</H1> No results were found. </BODY> </HTML>
Use "Connect" tags to display Search Results
The following "Connect" tag can be entered in a Presentation Templates or Component Design to display the results of a Search.
<CONNECT mod="template" srv="search" template='<PathCmpnt type="base"/><PathCmpnt type="context"/> /searchresultstemplate.html'> </CONNECT>"/searchresultstemplate.html" is the name of the Search Result page saved within the WCM WAR directory.
Optional: AjpeTemplate Tag
The AjpeTemplate Tag can be added to Presentation Template to enable AptrixSearch to filter results based on values set in this tag.
Example:
<AjpeTemplate>News</AjpeTemplate>If this tag was added to a Presentation Template, then a Search Query could be entered that would search for text on pages that have a AjpeTemplate value of "News".
Search Form Example
To allow users to search Pages profiled with the AjpeTemplate Tag of "News" only, the following code (in bold) is added to the Search Form:
<H2>Search Query</H2> <FORM METHOD="GET" ACTION="/wps/wcm/connect"> <p> <INPUT TYPE="HIDDEN" NAME="MOD" VALUE="AptrixSearch"> <INPUT TYPE="TEXT" NAME="QUERY" SIZE="56"> <INPUT TYPE="HIDDEN" NAME="FILTERTEMPLATE" VALUE="News"> <INPUT TYPE="HIDDEN" NAME="FILTEROUT" VALUE="False"> <INPUT TYPE="SUBMIT" VALUE="Search"> </p> <p><input type="radio" name="SEARCHTYPE" value="AND" checked="yes"> <p><input type="radio" name="SEARCHTYPE" value="OR">OR</p> </FORM>Template is the name specified in the following setting in aptrixsearch.properties and is used to define an input field to search Pages with AjpeTemplate Tags.
ajpetemplatefilter.cgi.template=filtertemplateFilterout is the name specified in the following setting in aptrixsearch.properties:
ajpetemplatefilter.cgi.filterout=filterout
- If VALUE="True", then any Page with a matching AjpeTemplate Tag will not be displayed.
- If VALUE="False", then Pages with a matching AjpeTemplate Tag will only be displayed.
If the AjpeTemplate Tag is to be used, then the Resultset Filter Class must be set to the following in aptrixsearch.properties.
resultsfilter.class=com.aptrix.pluto.search.fulltext.AjpeTemplateFilter
Search Process
When the Search Module is enabled, a Search Index is created. This is refreshed at a regular interval based on settings set in the aptrixsearch.properties configuration file. The Search application will return "no-results" until this index is created.
Non-ascii characters can not be used in the query string section of URLs. For this reason, it is best not to name WCM items using Non-ascii characters if you plan to use the WCM search feature.
Parent topic: Search Options.
IBM Workplace WCM - V5.1.0.1 -
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.