Another type of scope is the remote search service scope
which uses external search engines.
You must be logged in as administrator to add an External
Search Results portlet to the Search Center.
The search engine
service that you want to use must provide a web interface and return
the search result as either an RSS or Atom feed. For example, the
search result page which Google would return is HTML-based and cannot
be rendered within the External Search Result portlet.
There are two approaches for configuring external searches:
- One approach is to define external scopes that allow your visitors
to directly start external searches from the scope drop-down of the
search box. The search results display in a new browser window.
- The other approach is to define an external search engine that
contributes results to the Search Center results page. Site visitors
see the external search engine results from the Search Center page
in the External Results portlet. The following procedure describes
how you do this.
- Go to the page.
- Search for the string External. The portlet that you want to modify is named External Search
Results.
- Edit the value of the searchEngineUrl parameter. This value represents the URL of the third party search engine
that you want to be queried. You must include the ${searchTerms} in
the value. During a search query, ${searchTerms} is
replaced by the actual query. Example search engine
URLs:
- Google News:
- http://news.google.com/news?output=rss&q=${searchTerms}
- Yahoo News:
- http://news.search.yahoo.com/news/rss?p=${searchTerms}&ei=UTF-8&eo=UTF-8
- Flickr:
- http://www.flickr.com/services/feeds/photos_public.gne?tags=${searchTerms}&format=atom
- Optional: You can also add a More link
to the end of the External Search Results that links to the engine
page. For example:
- Edit the searchEngineFullPageUrl parameter.
- In the Value field, paste the
engine URL plus ${searchTerms}. For
example: http://www.ibm.com/developerworks/search/searchResults.jsp?searchSite=dW&searchScope=dW&query=${searchTerms}
- To save your changes, click OK twice.
- Adapt the proxy configuration file of the Search Center
portlet. Proceed as follows:
- Open the following file with an editor: /wp_profile/installedApps/cell_name/PA_Search_Center.ear/searchCenter.war/WEB-INF/proxy-config.xml
- Specify the URL for the third party search engine in
the proxy policy tag <proxy:policy> . For
example, for Yahoo News, the proxy policy tag looks as follows:
<proxy:policy url="http://news.search.yahoo.com/news/*" acf="none">
<proxy:actions>
<proxy:method>GET</proxy:method>
<proxy:method>HEAD</proxy:method>
</proxy:actions>
<proxy:mime-types>
<proxy:mime-type>text/xml*</proxy:mime-type>
<proxy:mime-type>application/xml*</proxy:mime-type>
<proxy:mime-type>application/atom+xml*</proxy:mime-type>
<proxy:mime-type>application/rss+xml*</proxy:mime-type>
</proxy:mime-types>
</proxy:policy>
- Stop and restart the Search Center application. To
do this, you access the WebSphere Integrated Solutions Console and
click . Then you can stop
and restart the Search Center application.
To add results from additional external search engines,
clone and configure additional External Search Result portlets, add
them to the Search Center page and update the file proxy-config.xml accordingly.