Google Custom Search Engine (Site Search ~ CSE) Integration
Pimcore provides a simple interface to the Google Custom Search Engine which makes it easy to integrate a search engine into your website.
Further information about Google CSE
Setup in CSE Control Panel and Google Cloud Console
- Create and configure a new search engine at http://www.google.com/cse/ - for more information please visit: http://support.google.com/customsearch/ .
- Test your search engine first using the preview on the right hand side.
- If your results are as expected, go back to "Setup" (-> left navigation) and note the search engine ID
- You'll need it later in the code (parameter 'cx' in configuration):
- Once you are finished go to https://console.developers.google.com/
create a new project, then search for
Custom Search APIand click on
Custom Search APIshould now be listed under
Enabled APIsin your project overview.
- To get the necessary access keys, click on:
Server keyComplete the setup as described and note the server API key.
So now we got the search engine ID and a server API key which we need to finish the configuration in Pimcore.
Server API Key
Open the system settings in Pimcore and paste the API key into the marked field below and save.
Search engine ID
The search engine ID is used in your controller/action to configure the search service:
The place of interest (parameter cx) is marked with a comment in the code example below.
Partial View Script (includes/paging.php)