< Manual:Hooks
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: In extension.json:
{
	"Hooks": {
		"SearchIndexFields": "MyExtensionHooks::onSearchIndexFields"
	}
}
Called from: File(s): SearchEngine.php
Interface: SearchIndexFieldsHook.php

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

Details

  • 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.

This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.