3 namespace MediaWiki\Content\Hook
;
5 use MediaWiki\Content\ContentHandler
;
6 use MediaWiki\Parser\ParserOutput
;
7 use MediaWiki\Revision\RevisionRecord
;
12 * This is a hook handler interface, see docs/Hooks.md.
13 * Use the hook name "SearchDataForIndex" to register handlers implementing this interface.
15 * @stable to implement
18 interface SearchDataForIndex2Hook
{
21 * Use this hook to add data to search document. Allows you to add any data to
22 * the field map used to index the document.
26 * @param array &$fields Array of name => value pairs for fields
27 * @param ContentHandler $handler ContentHandler for the content being indexed
28 * @param WikiPage $page WikiPage that is being indexed
29 * @param ParserOutput $output ParserOutput that is produced from the page
30 * @param SearchEngine $engine SearchEngine for which the indexing is intended
31 * @param RevisionRecord $revision RevisionRecord being indexed
32 * @return bool|void True or no return value to continue or false to abort
34 public function onSearchDataForIndex2(
36 ContentHandler
$handler,
40 RevisionRecord
$revision