< Manual:Hooks
This deprecated feature should no longer be used, but is still available for reasons of backwards compatibility.
This feature was deprecated in version 1.27.0. Instead, we recommend overriding SearchEngine::completionSearchBackend and other completion function as needed. See: mailarchive:wikitech-l/2016-February/084776.html |
| PrefixSearchBackend | |
|---|---|
| Available from version 1.12.0 Override the title prefix search used for OpenSearch and AJAX search suggestions. | |
| Define function: | public static function onPrefixSearchBackend( $ns, $search, $limit, &$results ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"PrefixSearchBackend": "MyExtensionHooks::onPrefixSearchBackend"
}
}
|
| Called from: | File(s): search/PrefixSearch.php, search/SearchEngine.php |
| Interface: | PrefixSearchBackendHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:PrefixSearchBackend extensions.
Details
$ns: int namespace key to search in$search: search term (not guaranteed to be conveniently normalized)$limit: maximum number of results to return&$results: out param: array of page names (strings)
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.