Manual:Hooks/CirrusSearchAddQueryFeatures

From MediaWiki.org
Jump to: navigation, search
CirrusSearchAddQueryFeatures
Available from version 1.29.0
Allows extensions to add query parser features
Define function:
public static function onCirrusSearchAddQueryFeatures( \CirrusSearch\SearchConfig $config, array &$extraFeatures ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"CirrusSearchAddQueryFeatures": [
			"MyExtensionHooks::onCirrusSearchAddQueryFeatures"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['CirrusSearchAddQueryFeatures'][] = 'MyExtensionHooks::onCirrusSearchAddQueryFeatures';
Called from: File(s): Searcher.php

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

This hook is a part of CirrusSearch extensionExtension:CirrusSearch.

Details[edit]

  • $config - SearchConfig object which holds current search configuration
  • $extraFeatures - array holding feature objects. This is where the extension should add its features. The feature class should implement \CirrusSearch\Query\KeywordFeature.

See also[edit]