And start indicating that hooks relying on this data might become unreliable as this data is only populated by SearchDatabase search engines. This information was only populated by SearchDatabase implementations and due to bad initial design of SearchResult[Set] (now fixed) it forced users of these classes to carry this information for the sole purpose of highlighting. Because SearchEngine can now own their SearchResult[Set] implementations nothing that is engine specific should be exposed outside of these specific implementations. If there are some logic that still requires access to such list of terms they should be made engine specific by guarding their code against instanceof SqlSearchResult. Change-Id: I38b82c5e4c35309ee447edc3ded60ca6a18b247a Depends-On: I53fe37c65c7940f696c1e184125e01e592a976e4
17 lines
368 B
PHP
17 lines
368 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Widget\Search;
|
|
|
|
use SearchResult;
|
|
|
|
/**
|
|
* Renders a single search result to HTML
|
|
*/
|
|
interface SearchResultWidget {
|
|
/**
|
|
* @param SearchResult $result The result to render
|
|
* @param int $position The zero indexed result position, including offset
|
|
* @return string HTML
|
|
*/
|
|
public function render( SearchResult $result, $position );
|
|
}
|