Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace CirrusSearch\BuildDocument\Completion; |
4 | |
5 | /** |
6 | * Scoring methods used by the completion suggester |
7 | * |
8 | * Set $wgSearchType to 'CirrusSearch' |
9 | * |
10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by |
12 | * the Free Software Foundation; either version 2 of the License, or |
13 | * (at your option) any later version. |
14 | * |
15 | * This program is distributed in the hope that it will be useful, |
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | * GNU General Public License for more details. |
19 | * |
20 | * You should have received a copy of the GNU General Public License along |
21 | * with this program; if not, write to the Free Software Foundation, Inc., |
22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 | * http://www.gnu.org/copyleft/gpl.html |
24 | */ |
25 | interface SuggestScoringMethod { |
26 | /** |
27 | * @param array $doc A document from the PAGE type |
28 | * @return int the weight of the document |
29 | */ |
30 | public function score( array $doc ); |
31 | |
32 | /** |
33 | * The list of fields needed to compute the score. |
34 | * |
35 | * @return string[] the list of required fields |
36 | */ |
37 | public function getRequiredFields(); |
38 | |
39 | /** |
40 | * This method will be called by the indexer script. |
41 | * some scoring method may want to normalize values based index size |
42 | * |
43 | * @param int $maxDocs the total number of docs in the index |
44 | */ |
45 | public function setMaxDocs( $maxDocs ); |
46 | |
47 | /** |
48 | * Explain the score |
49 | * @param array $doc |
50 | * @return array |
51 | */ |
52 | public function explain( array $doc ); |
53 | } |