Manual:Hooks/SearchGetNearMatch

SearchGetNearMatch
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": "MediaWiki\\Extension\\MyExtension\\Hooks::onSearchGetNearMatch"
	}
}
Called from: File(s): SearchEngine.php
Interface: SearchGetNearMatchHook.php

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

Details

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