Extension:GoogleSiteSearch

This extension allows you to add Google Custom Search Engine (CSE) results to Special:Search MediaWiki search results, or optionally, replace them altogether.

For an example, please see this search result on finnix.org.

Installation

 * Go to the Google CSE management page and add a custom search engine.
 * Make a note of the "Search engine unique ID". It should be in the format  .
 * Edit LocalSettings.php in the root of your MediaWiki installation, and add the following lines near the bottom (replacing   with the search engine ID noted above):
 * Verify Special:Search is working on your wiki.

Configuration
The following configuration globals are available:
 * - The ID of the created Google custom search engine. Required.
 * - Whether to replace the the MediaWiki search results. If true, only the CSE search results are shown.  If false, the CSE results are shown above the MediaWiki results.  Optional, defaults to false.

In addition, the HTML built by the extension is customizable. The defaults are usually sufficient (configuration values replaced automatically, search term inserted, and the user's language preference is passed on to the CSE code automatically). However, if you wish to modify the HTML, copy  to   and modify.

Internationalization
Translation of the extension strings is managed by Translatewiki.net (direct link). Please contribute translations there.

Internationalization of the Google results themselves is handled by passing the user's (or site default's) language preference to Google CSE. This is handled automatically and requires no configuration.

Modification of older MediaWiki releases
This extension relies on a MediaWiki hook which is not yet available, but is scheduled to be released with MediaWiki 1.21. If you would like to use this extension with MediaWiki 1.20 or earlier, you will need to modify the MediaWiki source to add the hook.

Edit  and look for the following comment, somewhere around line 280:

Insert the following code above that comment: