< Manual:Hooks
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": "MyExtensionHooks::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

  • $term : Search term string
  • &$title : Outparam; set to $title object and return false for a match
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.