ShowTable of Contents
WebSphere Portal search allows you to search Lotus Web Content Management (hereafter called WCM) content in different ways and from different portlets. In the prerequisite articles, “Advanced WCM/WebSphere Portal Search Integration"
and “Extend WebSphere Portal WCM Seedlist with Custom Metadata,"
you learned how to use WebSphere Portal search to return results from the WCM server and to extend its metadata with custom metadata.
Now, in this article, it's time to learn the steps necessary to extend Search Center display with WCM metadata in WebSphere Portal 6.1.5.
Figure 1 shows an example of WCM search results enriched with a new field, that is, the language of the content item. In this example the field was added in a new column; however, it is also possible to just add it as additional information under the search result.
Figure 1. WCM search results enriched with “Language” field
Since this article is based on existing articles that explain how to expose WCM custom metadata through WCM seedlist, it is more focused on the required configuration of the Search Engine and Search Center size.
It is assumed that your environment includes the following:
WebSphere Portal versions 6.1.5 and later
PM21390 - (WCM) Seedlist performance fix
PM12951 – Support configuration of returnable fields in Search Feed level
First, let's deep-dive into the architecture of Portal Search and its integration with the WCM rendered content. It's important to understand the architecture and the technical terms before going into the detailed configuration steps.
Figure 2 shows a high-level diagram of Portal Search integrated with WCM rendered content.
Figure 2. Portal Search and WCM Rendered Content
Below is a more detailed description of each “actor” in the above framework:
Search Center Portlet: The main out-of-the-box search portlet in WebSphere Portal, it is used for searching using scopes over Portal and WCM content. It is Ajax based and calls the Search Feed for getting the search results.
Portal Search Engine: The Portal module that crawls the WCM Seedlist, processes and indexes the content in a search index, and then later allows searching against it, also using metadata.
WCM Seedlist: Seedlist page in Atom format with all WCM content, including related metadata (like title, author, templates) and access control information. (Here we are referring to the WCM Seedlist 1.0 format.)
Search Feed (Search REST Service): A Servlet that exposes search results in Atom format with OpenSearch extensions.
In the following sections we describe the required configuration steps for leveraging your WCM content metadata and displaying it for each search result in the Portal Search Center.
Exposing WCM metadata for search through the WCM Seedlist
In order to have WCM metadata fields display, you must first publish them in the WCM Seedlist. For more details on how to expose WCM metadata in the Seedlist, refer to the “Advanced WCM/WebSphere Portal Search Integration"
and “Extend WebSphere Portal WCM Seedlist with Custom Metadata,"
So, for example, by using the relevant instructions from the first-mentioned article, you should be able to add a new custom field called "language" to WCM content and see it in the WCM Seedlist. Note that the field will be added to the Seedlist in the following format:
“META_<field>”, with “META_” prefix
and in this example it will look like “META_language”.
Figure 3 shows a fragment from the Seedlist that describes a single WCM content item entry with all published fields and, specifically, the new custom field of “language”.
Figure 3. WCM Seedlist with Language as additional metadata
Exposing WCM metadata through Search Feed (Search REST Servlet)
Now that you've configured WCM and exposed the new custom field “language” in the Seedlist, it's time expose the same field through the Search Feed. Exposing the field through the Search Feed is required as a first step before displaying it in the Search Center for each relevant search result.
To add the “language” field to the Search Feed output, follow these steps:
Access the Admin Console and select Applications > WebSphere enterprise applications.
Search for the “Feed_Servlet” application.
Go to Initialize parameters for Servlet and add all required fields (using comma separator) as values to outputFields parameter. Figure 4 shows how the parameter looks in the Admin Console UI.
Figure 4. Configuring “language” field to be returned in the Search Feed output
To check that the configuration was done correctly and did effect the Search Feed, you can access the search feed URL from the browser, using this format:
In figure 5 you can see a snippet that was taken from a Search Feed output that includes the “language” field with the search result entry in the feed.
Figure 5. Search Feed output snippet including WCM search result with “language” field
If you are not clear on how to construct the URL, navigate to the Portlet Search Center and, using firebug Firefox plug-in, you can determine the correct URL that's being called by the Search Center Portlet.
Manipulating the Search Center Portlet results display
Now that the Search Feed returns the required WCM metadata fields, we can move to the last phase and explain how to manipulate the search results display in the Search Center UI.
The Search Center Portlet calls the Search Feed and, as a result, it gets an Atom feed that needs to be processed and transformed into HTML. The file that helps with this process is results.xsl.
example of the updated results.xsl
file is in the Attachments section of this article.
After replacing the results.xsl file with the updated results.xsl, you would expect that the search results display will change to be the same as in figure 1. However, the browser cache must be cleared for the change to take effect. On the server the file can be found under:
Adding a date format field
If you want to add a metadata field that is in a date format (like an effective date
), then an additional file must be updated to display it properly. This file is DisplayResultsWidgets.js,
an updated example of which can be found in Attachments section.
Again, the browser cache must be cleared for the change to be effective. On the server the file can be found under:
In this article you've learned about WCM custom metadata and the options to leverage it in the context of search. Assuming you already know how to use WebSphere Portal search to return results from the WCM server and to extend the search with custom metadata, here we've closed up the last gap, explaining the steps necessary to extend Search Center display with WCM metadata in WebSphere Portal 6.1.5.
WebSphere Portal and Lotus Web Content Management product documentation:
“Integrating IBM WebSphere Portal Search with IBM Workplace Web Content Management for version 6”:
Advanced WCM/WebSphere Portal Search Integration:
Extend WebSphere Portal WCM Seedlist with Custom Metadata:
“Making content searchable anywhere using IBM WebSphere Portal's publishing Seedlist Framework”:
About the authors
Eitan Shapiro joined IBM in 2005 and is currently the Manager of the Enterprise Information Discovery team that develops search solutions for WebSphere Portal and Lotus Quickr®. He holds a BSc degree in Information Systems Engineering from the Technion, Haifa, Israel.
Veronika Bogina joined IBM in 2008 and is currently a Level 3 Support and Software Engineer working on the team that develops search solutions for WebSphere Portal and Lotus Quickr. She holds a BSc degree in Information Systems Engineering from the Technion, Haifa, Israel.