Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 71 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | // Wikibase prefix search scoring profile for CirrusSearch. |
3 | // This profile applies to the whole document. |
4 | // These configurations define how the results are ordered. |
5 | // The names should be distinct from other Cirrus rescoring profile, so |
6 | // prefixing with 'wikibase' is recommended. |
7 | return [ |
8 | 'wikibase_prefix' => [ |
9 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-prefix', |
10 | 'supported_namespaces' => 'all', |
11 | 'rescore' => [ |
12 | [ |
13 | 'window' => 8192, |
14 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
15 | 'query_weight' => 1.0, |
16 | 'rescore_query_weight' => 1.0, |
17 | 'score_mode' => 'total', |
18 | 'type' => 'function_score', |
19 | 'function_chain' => 'entity_weight' |
20 | ], |
21 | ] |
22 | ], |
23 | // Profile that uses both entity weight end statement-based boosts |
24 | 'wikibase_prefix_boost' => [ |
25 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-prefix-boost', |
26 | 'supported_namespaces' => 'all', |
27 | 'rescore' => [ |
28 | [ |
29 | 'window' => 8192, |
30 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
31 | 'query_weight' => 1.0, |
32 | 'rescore_query_weight' => 1.0, |
33 | 'score_mode' => 'total', |
34 | 'type' => 'function_score', |
35 | 'function_chain' => 'entity_weight_boost' |
36 | ], |
37 | ] |
38 | ], |
39 | // Fulltext profile |
40 | 'wikibase' => [ |
41 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-fulltext', |
42 | 'supported_namespaces' => 'all', |
43 | 'rescore' => [ |
44 | [ |
45 | 'window' => 8192, |
46 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
47 | 'query_weight' => 1.0, |
48 | 'rescore_query_weight' => 1.0, |
49 | 'score_mode' => 'total', |
50 | 'type' => 'function_score', |
51 | 'function_chain' => 'entity_weight_boost' |
52 | ], |
53 | ] |
54 | ], |
55 | // Fulltext profile with phrase scoring |
56 | 'wikibase_phrase' => [ |
57 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-fulltext-phrase', |
58 | 'supported_namespaces' => 'all', |
59 | 'rescore' => [ |
60 | // phrase rescore |
61 | [ |
62 | 'window' => 512, |
63 | 'window_size_override' => 'CirrusSearchPhraseRescoreWindowSize', |
64 | 'rescore_query_weight' => 10, |
65 | 'rescore_query_weight_override' => 'CirrusSearchPhraseRescoreBoost', |
66 | 'query_weight' => 1.0, |
67 | 'type' => 'phrase', |
68 | // defaults: 'score_mode' => 'total' |
69 | ], |
70 | [ |
71 | 'window' => 8192, |
72 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
73 | 'query_weight' => 1.0, |
74 | 'rescore_query_weight' => 2.0, |
75 | 'score_mode' => 'total', |
76 | 'type' => 'function_score', |
77 | 'function_chain' => 'entity_weight_boost' |
78 | ], |
79 | ] |
80 | ] |
81 | ]; |