MediaWiki REL1_39
MediaWiki\Search\Hook\ShowSearchHitHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inheritance diagram for MediaWiki\Search\Hook\ShowSearchHitHook:

Public Member Functions

 onShowSearchHit ( $searchPage, $result, $terms, &$link, &$redirect, &$section, &$extract, &$score, &$size, &$date, &$related, &$html)
 Use this hook to customize display of search hit.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ShowSearchHit" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 15 of file ShowSearchHitHook.php.

Member Function Documentation

◆ onShowSearchHit()

MediaWiki\Search\Hook\ShowSearchHitHook::onShowSearchHit ( $searchPage,
$result,
$terms,
& $link,
& $redirect,
& $section,
& $extract,
& $score,
& $size,
& $date,
& $related,
& $html )

Use this hook to customize display of search hit.

Since
1.35
Parameters
SpecialSearch$searchPage
SearchResult$resultSearchResult to show
string[]$termsSearch terms, for highlighting (unreliable as search engine dependent)
string&$linkHTML of link to the matching page. May be modified.
string&$redirectHTML of redirect info. May be modified.
string&$sectionHTML of matching section. May be modified.
string&$extractHTML of content extract. May be modified.
string&$scoreHTML of score. May be modified.
string&$sizeHTML of page size. May be modified.
string&$dateHTML of page modification date. May be modified.
string&$relatedHTML of additional info for the matching page. May be modified.
string&$htmlMay be set to the full HTML that should be used to represent the search hit. Must include the <li> ... </li> tags. Will only be used if the hook function returned false.
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: