Manual:Hooks/SearchDataForIndex
Appearance
Deprecated: This feature is deprecated and should no longer be used, however it is still available for reasons of backwards compatibility . |
SearchDataForIndex | |
---|---|
Available from version 1.28.0 Allows to provide custom content fields when indexing a document. | |
Define function: | public static function onSearchDataForIndex( array &$fields, ContentHandler $handler, WikiPage $page, ParserOutput $output, SearchEngine $engine ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"SearchDataForIndex": "MediaWiki\\Extension\\MyExtension\\Hooks::onSearchDataForIndex"
}
}
|
Called from: | File(s): SearchEngine.php |
Interface: | SearchDataForIndexHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:SearchDataForIndex extensions.
Details
[edit]- array &$fields: Array of name => value pairs for fields
- ContentHandler $handler: ContentHandler for the content being indexed
- WikiPage $page: WikiPage that is being indexed
- ParserOutput $output: ParserOutput that is produced from the page
- SearchEngine $engine: SearchEngine for which the indexing is intended
Add data to search document. Allows an extension to add any data to the field map used to index the document.