Integrating Google Search API to AC Gold

From AbleCommerce Wiki
Revision as of 11:28, 31 August 2015 by Nadeem (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Google WebSearch service provides a powerful way to display search results for the customers to their own web sites. It also provides complete control over the customization and displaying search results. It is very easy to integrate Google Custom Search API in Ablecommerce. This article will discuss the integration of Google Custom Search API in ablecommerce.

First of all, we need to define a Custom Search Engine using google control panel. Here is the step by step procedure to do this:

To create a custom search engine:

  • Sign into Control Panel [1] using your Google Account (create new account if you don't already have one).
  • In the Sites to search section, add the pages you want to include in your search engine. You can include any sites you want, not just the sites you own. You can include whole site URLs or individual pages URLs. You can also use URL patterns.
  • The name of your search engine will be automatically generated based on the URLs you select. You can change this name at any time.
  • Select the language of your search engine. This defines the language of the buttons and other design elements of your search engine, but doesn't affect the actual search results.
  • Click Create.

Now the basic search engine setup is completed and ready to use. There are three required parameters that must be sent in search request, these parameters are:

1. client

The client parameter must be set to google-csbe

2. output

The output parameter specifies the format of the returned XML results; results can be returned with (xml) or without (xml_no_dtd) a reference to Google's DTD. We recommend setting this value to xml_no_dtd. Note: If you do not specify this parameter, then results will be returned in HTML instead of XML.

3. cx

The cx parameter which represents the unique ID of the CSE. This cx value can be obtained from Details section from search engine setup control panel.

For more details and adding other advanced optional parameters, visit API reference guide here [2]