Open main menu

Manual:Hooks/SearchGetNearMatchBefore

SearchGetNearMatchBefore
Available from version 1.16.0
Perform exact-title-matches in "go" searches before the normal operations.
Define function:
public static function onSearchGetNearMatchBefore( $allSearchTerms, &$titleResult ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SearchGetNearMatchBefore": "MyExtensionHooks::onSearchGetNearMatchBefore"
	}
}

For MediaWiki ‚ȧ1.25:

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

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

DetailsEdit

  • $allSearchTerms¬†: Array of the search terms in all content languages
  • $titleResult¬†: Outparam; the value to return. A Title object or null.