Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 36
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3// Matches the syntax of Cirrus rescore profiles, e.g. in RescoreProfiles.config.php
4
5$phraseRescorePlaceHolder = [
6    'window' => 512,
7    'window_size_override' => 'CirrusSearchPhraseRescoreWindowSize',
8    'rescore_query_weight' => 10,
9    'rescore_query_weight_override' => 'CirrusSearchPhraseRescoreBoost',
10    'query_weight' => 1.0,
11    'type' => 'phrase',
12    // defaults: 'score_mode' => 'total'
13];
14
15return [
16    // same as `classic_noboostlinks`, except that the template boost scores
17    // are not multiplied, only the max template boost will be used
18    'classic_noboostlinks_max_boost_template' => [
19        'i18n_msg' => 'wikibasemediainfo-rescore-profile-classic-noboostlinks-max-boost-template',
20        'supported_namespaces' => 'all',
21        'rescore' => [
22            $phraseRescorePlaceHolder,
23            [
24                'window' => 8192,
25                'window_size_override' => 'CirrusSearchFunctionRescoreWindowSize',
26                'query_weight' => 1.0,
27                'rescore_query_weight' => 1.0,
28                'score_mode' => 'multiply',
29                'type' => 'function_score',
30                'function_chain' => 'optional_chain_no_template_boost',
31            ],
32            [
33                'window' => 8192,
34                'window_size_override' => 'CirrusSearchFunctionRescoreWindowSize',
35                'query_weight' => 1.0,
36                'rescore_query_weight' => 1.0,
37                'score_mode' => 'multiply',
38                'type' => 'function_score',
39                'function_chain' => 'template_boost_only',
40            ],
41        ]
42    ],
43];