Extension:SphinxSearch/SphinxSearchBeforeQuery

From MediaWiki.org
Jump to navigation Jump to search
SphinxSearchBeforeQuery
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.

Details[edit]

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