| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Content\Hook; |
| 4 | |
| 5 | use MediaWiki\Content\ContentHandler; |
| 6 | use MediaWiki\Parser\ParserOutput; |
| 7 | use MediaWiki\Revision\RevisionRecord; |
| 8 | use SearchEngine; |
| 9 | use WikiPage; |
| 10 | |
| 11 | /** |
| 12 | * This is a hook handler interface, see docs/Hooks.md. |
| 13 | * Use the hook name "SearchDataForIndex" to register handlers implementing this interface. |
| 14 | * |
| 15 | * @stable to implement |
| 16 | * @ingroup Hooks |
| 17 | */ |
| 18 | interface SearchDataForIndex2Hook { |
| 19 | |
| 20 | /** |
| 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. |
| 23 | * |
| 24 | * @since 1.40 |
| 25 | * |
| 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 |
| 33 | */ |
| 34 | public function onSearchDataForIndex2( |
| 35 | array &$fields, |
| 36 | ContentHandler $handler, |
| 37 | WikiPage $page, |
| 38 | ParserOutput $output, |
| 39 | SearchEngine $engine, |
| 40 | RevisionRecord $revision |
| 41 | ); |
| 42 | } |