Extension:CirrusSearch/Hooks/CirrusSearchScoreBuilder

From MediaWiki.org
Jump to navigation Jump to search
CirrusSearchScoreBuilder
Available from version 1.29.0
Allows extensions to define rescore builder functions
Define function:
public static function onCirrusSearchScoreBuilder( array $func, \CirrusSearch\Search\SearchContext $context, &$builder ) { ... }
Attach hook:
$wgHooks['CirrusSearchScoreBuilder'][] = 'MyExtensionHooks::onCirrusSearchScoreBuilder';
Called from:File(s): includes/Search/RescoreBuilders.php

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

This hook is a part of CirrusSearch extension .

Details[edit]

  • $func - function definition map, with keys:
    • type - function name
    • weight - weight of this function in this specific profile
    • For other parameter examples, see RescoreProfiles.config.php
  • $context - SearchContext object
  • $builder - object implementing the function. Should be placed in this variable if this extension has it.

See also[edit]