Manual:Hooks/SearchIndexFields

From MediaWiki.org
Jump to: navigation, search
SearchIndexFields
Available from version 1.28.0
Add fields to search index mapping
Define function:
public static function onSearchIndexFields( array &$fields, SearchEngine $engine ) { ... }
Attach hook:
$wgHooks['SearchIndexFields'][] = 'MyExtensionHooks::onSearchIndexFields';
Called from: File(s): SearchEngine.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:SearchIndexFields extensions.

Details[edit]

  • array &$fields: Array of fields, all implement SearchIndexField.
  • SearchEngine $engine: SearchEngine instance for which mapping is being built.

Extension that wants to add a field to search index mapping can use this hook to inject search fields.