Manual:Hooks/SearchGetNearMatchBefore

From MediaWiki.org
Jump to navigation Jump to search
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.

Details[edit]

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