+

Search Tips   |   Advanced Search

Configure the External Search Results portlet


Overview

Configure a portlet that retrieves and displays search results from third-party search engines such as Yahoo or Google, then add the External Search Results portlet to the Search Center.

The External Search Results is a specialized portlet that administrators can add to Portal Search. When we add that portlet to Portal Search, the results of a search initiated from the Search page include results from third-party external search engines such as Yahoo or Google. We can add more than one copy of the External Search Results portlet to the Portal Search page, and we can configure each of these to display a specific number of search results.

  1. Be logged in as Administrator to add a External Search Results portlet to the Search Center.
  2. The External Search Results portlet can only be added to the Search Center on the Portal Search page. It will not function anywhere else.


Add External Search Results portlet to the Portal Search page

  1. If the External Search Results portlet was removed from the Search Center, add the portlet to the Search Center.

      Administration | Manage Pages | Content Root | Search | Search Center page | Edit Page Layout | Add Portlets | External Search Results portlet | OK | Done

  2. Configure the External Search Results portlet:

    1. From the main portal menu, click...

        Administration | Portlets | External Search Results | Configure icon

    2. Edit the value of the searchEngineUrl parameter.

      This value represents the URL of the third-party search engine to be queried. The string ${searchTerms} must be included in the value. This string is replaced by the actual query during the search.

      For example:

        http://www.ibm.com/developerworks/views/rss/customrssatom.jsp?zone_by=Lotus&search_by=${searchTerms}

      This URL returns a feed of search results for the specified search terms. The feed is in RSS or ATOM syndication format.

    3. Optional: Edit the value of the parameter searchEngineFullPageUrl.

      Optional. We can delete it or leave it empty. When you set this parameter, a More link is added to the portlet. It links to the Web site of the external search engine. The value represents a parameterized form of the URL used to locate the search engine that is queried. The string ${searchTerms} must be included in the parameter value. During the search the portlet replaces the string by the actual query.

        http://www.ibm.com/developerworks/search/searchResults.jsp?searchSite=dW&searchScope=dW&query=${searchTerms}

      This URL should return the public HTML page of the search engine.

    4. Edit the value of the numOfEntries parameter.

      This parameter determines the maximum number of search results which will be displayed. The default number is 3, but we can enter a different numeric value to increase the maximum.

    5. If the external search engine returns search results in a format that is not supported, or if the provided rendering of the search results is not acceptable, an XSLT file can be specified.

      Edit the value of the externalXsltUrl parameter to supply a URL for such an external XSLT file. The XSLT does not create an entire HTML document, but an HTML fragment that can be embedded inside a page.

    6. On the page for editing the preference searchEngineFullPageUrl, click OK.

    7. On the page for configuring the External Search Results portlet, click OK to save the changes.

    Users can now use the External Search Results portlet.

  3. Modify the proxy configuration of the portlet.

    All HTTP requests from the portlet to the external search engines are directed through the HTTP Proxy for AJAX Applications, which is included in the portal. The External Search Results portlet includes an application specific configuration for this proxy. In a standard portal installation it allows only connections to the URL of the default external search engine...

      http://www.ibm.com/developerworks/views/rss/*

    To change this, modify the proxy-config.xml file bundled with the portlet:

    1. Go to the file searchCenter.war located in...

    2. Edit WEB-INF/proxy-config.xml

    3. Add a new proxy:policy element, or modify the existing one as required.

      The current policy element allows connections to...

        http://www.ibm.com/developerworks/views/rss/*

      We can change the URL attribute to specify another site, for example...

        http://www.ibm.com/products/*

      To add several instances of the portlet on a page that show search results from different sources, duplicate the proxy:policy element. Add a policy element for each instance of the portlet, with the URL attribute matching the search source as required.

    4. Repackage the WAR file and update the Search Center Web module.

    Searches by users will now be performed by the modified search configuration.


Parent: Customize the Search Center
Related: Configure suggested links
Manage search scopes and custom links
Customize the All Sources scope
Examples of AJAX proxy configurations