Manual:Hooks/CirrusSearchMappingConfig

From MediaWiki.org
Jump to navigation Jump to search
CirrusSearchMappingConfig
Available from version 1.24.0
Allows configuration of the mapping of fields
Define function:
public static function onCirrusSearchMappingConfig( array &$config, MappingConfigBuilder $builder ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"CirrusSearchMappingConfig": "MyExtensionHooks::onCirrusSearchMappingConfig"
	}
}

For MediaWiki ≤1.25:

$wgHooks['CirrusSearchMappingConfig'][] = 'MyExtensionHooks::onCirrusSearchMappingConfig';
Called from:File(s): includes/Maintenance/MappingConfigBuilder.php

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

This hook is a part of CirrusSearch extension .

Details[edit]

  • $config - multi-dimensional configuration array that contains Elasticsearch document configuration.
    • The 'page' index contains configuration for Elasticsearch documents representing pages.
    • The 'namespace' index contains namespace configuration for Elasticsearch documents representing namespaces.
  • $builder - instance of MappingConfigBuilder, for easier use of utility methods to build fields.

See also[edit]