Integrating Google Search with Oracle WebLogic Portal

In this article we will discuss various approaches to integrating Google Search with an Oracle WebLogic Portal website. Google provides multiple powerful options to enable any content based website to find fast and relevant search results using its search technology. This article discusses these options and describes a sample Google Custom Search integration with Oracle WebLogic Portal 10 application.

Google Search Appliance (GSA)

The Google Search Appliance is an excellent option for large scale enterprise customers who want to provide search across a very large number of content items across multiple sites and systems. The Google Search Appliance is suited for customers which want a high degree of control over the search results, relevancy, overall management and administration of the search index and advanced security integration features. Additionally GSA can also index content from additional sources including databases, file shares and drives, intranet and third party sites with security and business applications. This is the most scalable and extensible option within Google's Search portfolio for large enterprise customers looking to extend Google's search technology within their enterprise.

Google Mini

Google Mini is a scaled down version of the GSA suited for medium - small business customers who are looking to index 50K-300K content items. The Google Mini provides many of the same capabilities as the GSA and has a cost effective solution for customers who want to provide Google search within their public facing website or corporate intranets.

Google Custom Search

This is Google's hosted search solution also referred to as Google Site Search. This option is suited for businesses and customers who want to leverage Google's search offering for a more targeted internet facing website which is accessible for indexing using Google's indexer - Googlebot. The primary advantage of Google Custom Search is to leverage Google's Search enhancements which are rolled into the service automatically. Since the inception of the service Google has added support for Synonyms i.e. associating documents to commonly used search queries, target top search results and date biasing i.e. influencing search rankings based on the age of the document. However enterprise customers looking for more advanced features such managing the index, fine grained control of relevancy of search results and security will need to opt for GSA or Google Mini. Google Custom Search provides a convenient hosted offering for customers who are looking to provide fast and relevant search results with minimal administration on their internet facing websites.

In the next section we will delve deeper into our example leveraging Google Custom Search and incorporating it within a sample Oracle WebLogic Portal 10 application. In this example we will establish a Google Custom Search account for the Oracle Technology Network section of the Oracle website. Next we will then showcase how to integrate it within a WebLogic Portal 10 application using Google's AJAX based search API.

The first step is to register and log into your Google account and select 'My Account' from the top menu. You will see 'Custom Search' as one of the offerings under 'My Product' section.

Google Custom Search

Click 'Custom Search' and you will see the option to 'Create a Custom Search Engine'. In the example custom search engine below we are going to create a search engine for the Oracle Technology Network.

Google Custom Search

Note we specified the oracle technology network site to limit our search results from within that segment of Oracles website. Complete the steps in the Wizard to complete the setup of your custom search engine. Google Custom Search provides a 'control panel' for your custom search to manage your settings and configuration and also preview search results. Using this panel test drive your new search engine using different keywords:

Google Custom Search

Note you have the option of turning off advertisements in search results pages using a Business Account or if you establishing one for a select nonprofit, universities and government agency.

Now we are ready to integrate our Google Custom Search with our WebLogic Portal application. Create a sample WebLogic Portal 10 application in Workshop and configure your portal server. We will create a JSP based portlet for our Google Custom Search. Within our JSP we will utilize the Google Search AJAX API to show results from our Google Custom Search account. The first step is to register and create a Google AJAX Search API key. You can do this by signing up here.

Note the Google AJAX Search API Key provided to you.

Google Custom Search

The results page will give you a basic web search using the AJAX API key. However our example is going to take this a step further by integrating the Google AJAX Search with our Google Custom Search account. Next go into your Google Custom Search Account and identify your custom search key. You can get this by going into your Google Custom Search control panel and clicking on the 'Get Code' link. This will bring up a page giving you multiple results integration options. Within the forms provided in these options you can extract your custom search key for use it in our sample integration.

Google Custom Search

The following is a JSP fragment from our sample integration provided at the end of this article. Plug in the values of your Google AJAX API key and Custom Search key in the scriptlet:

<%@ page import="java.io.*, java.util.*"%>
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
<%
String googleAjaxApiKey = "ABQIAAAAV19h2ZG_4pdbyWOkZop17RToA06N9T4QvhJA117nPhk5iXGyohQE91hidohG0nP761f7o4MotBEUuw";
String googleCustomSearchKey = "016389069140012838853:yp_hnzsuko8";
%>

...
		

Once you have completed this step you can run the provided sample within your WebLogic Portal application and get integrated Google Custom Search results using the AJAX provided form:

Google Custom Search

This sample utilizes a more customized implementation of the Google Search AJAX API to render the search results. We can now embed the sample portlet within any segment of our WebLogic Portal site to provide Google Custom Search integration. The Google Search AJAX API enables us to provide very fast and efficient search results within our WebLogic Portal application. In this sample we made additional customizations to integrate this Google Search AJAX API with WebLogic Portal by customizing the display of the search form and results to suit our needs.

Conclusion:

Google provides many compelling options to integrate its search technology for enterprises. The ease of integration combined with the scalability and performance of the Google platform makes Google Search a compelling option for anyone looking to provide fast relevant search results for their data. With 'search' established as the killer application, the use of Google Search to index and quickly access relevant data is set to grow at a rapid pace.

References:

Google Enterprise Search

Sample Download:

Google Custom Search integration sample with Oracle WebLogic Portal