Extension:CirrusSearch/Hooks/CirrusSearchScoreBuilder

From Linux Web Expert

Revision as of 10:28, 18 August 2020 by imported>SamanthaNguyen (remove redundant info, reformat)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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): CirrusSearch / 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.

Details

  • $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.