Open main menu


Available from version 0.7.2 (r73342)
Allow messing with search term and sphinx client before search is executed
Define function:
public static function onSphinxSearchBeforeQuery( &$term, &$cl ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"SphinxSearchBeforeQuery": "MyExtensionHooks::onSphinxSearchBeforeQuery"

For MediaWiki ≤1.25:

$wgHooks['SphinxSearchBeforeQuery'][] = 'MyExtensionHooks::onSphinxSearchBeforeQuery';
Called from:File(s): SphinxMWSearch.php

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


  • $term: string search term(s)
  • $cl: object SphinxClient