Available from version 1.12.0
An extra chance for exact-title-matches in "go" searches
Define function:
public static function onSearchGetNearMatch( $term, &$title ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"SearchGetNearMatch": "MyExtensionHooks::onSearchGetNearMatch"

For MediaWiki ≤1.25:

$wgHooks['SearchGetNearMatch'][] = 'MyExtensionHooks::onSearchGetNearMatch';
Called from:File(s): SearchEngine.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:SearchGetNearMatch extensions.


  • $term : Search term string
  • &$title : Outparam; set to $title object and return false for a match