Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 86 |
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 | 'wikibase_in_label' => [ |
| 24 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-in-label', |
| 25 | 'supported_namespaces' => 'all', |
| 26 | 'rescore' => [ |
| 27 | [ |
| 28 | 'window' => 8192, |
| 29 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
| 30 | 'query_weight' => 1.0, |
| 31 | 'rescore_query_weight' => 1.0, |
| 32 | 'score_mode' => 'total', |
| 33 | 'type' => 'function_score', |
| 34 | 'function_chain' => 'entity_weight' |
| 35 | ], |
| 36 | ] |
| 37 | ], |
| 38 | // Profile that uses both entity weight end statement-based boosts |
| 39 | 'wikibase_prefix_boost' => [ |
| 40 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-prefix-boost', |
| 41 | 'supported_namespaces' => 'all', |
| 42 | 'rescore' => [ |
| 43 | [ |
| 44 | 'window' => 8192, |
| 45 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
| 46 | 'query_weight' => 1.0, |
| 47 | 'rescore_query_weight' => 1.0, |
| 48 | 'score_mode' => 'total', |
| 49 | 'type' => 'function_score', |
| 50 | 'function_chain' => 'entity_weight_boost' |
| 51 | ], |
| 52 | ] |
| 53 | ], |
| 54 | // Fulltext profile |
| 55 | 'wikibase' => [ |
| 56 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-fulltext', |
| 57 | 'supported_namespaces' => 'all', |
| 58 | 'rescore' => [ |
| 59 | [ |
| 60 | 'window' => 8192, |
| 61 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
| 62 | 'query_weight' => 1.0, |
| 63 | 'rescore_query_weight' => 1.0, |
| 64 | 'score_mode' => 'total', |
| 65 | 'type' => 'function_score', |
| 66 | 'function_chain' => 'entity_weight_boost' |
| 67 | ], |
| 68 | ] |
| 69 | ], |
| 70 | // Fulltext profile with phrase scoring |
| 71 | 'wikibase_phrase' => [ |
| 72 | 'i18n_msg' => 'wikibasecirrus-rescore-profile-fulltext-phrase', |
| 73 | 'supported_namespaces' => 'all', |
| 74 | 'rescore' => [ |
| 75 | // phrase rescore |
| 76 | [ |
| 77 | 'window' => 512, |
| 78 | 'window_size_override' => 'CirrusSearchPhraseRescoreWindowSize', |
| 79 | 'rescore_query_weight' => 10, |
| 80 | 'rescore_query_weight_override' => 'CirrusSearchPhraseRescoreBoost', |
| 81 | 'query_weight' => 1.0, |
| 82 | 'type' => 'phrase', |
| 83 | // defaults: 'score_mode' => 'total' |
| 84 | ], |
| 85 | [ |
| 86 | 'window' => 8192, |
| 87 | 'window_size_override' => 'EntitySearchRescoreWindowSize', |
| 88 | 'query_weight' => 1.0, |
| 89 | 'rescore_query_weight' => 2.0, |
| 90 | 'score_mode' => 'total', |
| 91 | 'type' => 'function_score', |
| 92 | 'function_chain' => 'entity_weight_boost' |
| 93 | ], |
| 94 | ] |
| 95 | ] |
| 96 | ]; |