Manual:Hooks/SpecialSearchNogomatch

SpecialSearchNogomatch
Available from version 1.6.0
Called when the 'Go' feature is triggered (generally from autocomplete search other than the main bar on Special:Search) and the target doesn't exist. Full text search results are generated after this hook is called.
Define function:
public static function onSpecialSearchNogomatch( &$title ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"SpecialSearchNogomatch": "MediaWiki\\Extension\\MyExtension\\Hooks::onSpecialSearchNogomatch"
	}
}
Called from: File(s): specials/SpecialSearch.php
Interface: SpecialSearchNogomatchHook.php

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

Details

edit
  • $title will be the Title object of the page searched for if it doesn't exist. This hook only runs if the page being searched for doesn't exist.