| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Content\Hook; |
| 4 | |
| 5 | use MediaWiki\Content\ContentHandler; |
| 6 | use MediaWiki\Parser\ParserOutput; |
| 7 | use SearchEngine; |
| 8 | use WikiPage; |
| 9 | |
| 10 | /** |
| 11 | * This is a hook handler interface, see docs/Hooks.md. |
| 12 | * Use the hook name "SearchDataForIndex" to register handlers implementing this interface. |
| 13 | * |
| 14 | * @stable to implement |
| 15 | * @deprecated since 1.40, use SearchDataForIndexHook2 instead. |
| 16 | * @ingroup Hooks |
| 17 | */ |
| 18 | interface SearchDataForIndexHook { |
| 19 | /** |
| 20 | * Use this hook to add data to search document. Allows you to add any data to |
| 21 | * the field map used to index the document. |
| 22 | * |
| 23 | * @since 1.35 |
| 24 | * |
| 25 | * @param array &$fields Array of name => value pairs for fields |
| 26 | * @param ContentHandler $handler ContentHandler for the content being indexed |
| 27 | * @param WikiPage $page WikiPage that is being indexed |
| 28 | * @param ParserOutput $output ParserOutput that is produced from the page |
| 29 | * @param SearchEngine $engine SearchEngine for which the indexing is intended |
| 30 | * @return bool|void True or no return value to continue or false to abort |
| 31 | */ |
| 32 | public function onSearchDataForIndex( &$fields, $handler, $page, $output, |
| 33 | $engine |
| 34 | ); |
| 35 | } |