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
3namespace CirrusSearch\BuildDocument\Completion;
4
5/**
6 * Scoring methods used by the completion suggester
7 *
8 * Set $wgSearchType to 'CirrusSearch'
9 *
10 * @license GPL-2.0-or-later
11 */
12interface SuggestScoringMethod {
13    /**
14     * @param array $doc A document from the PAGE type
15     * @return int the weight of the document
16     */
17    public function score( array $doc );
18
19    /**
20     * The list of fields needed to compute the score.
21     *
22     * @return string[] the list of required fields
23     */
24    public function getRequiredFields();
25
26    /**
27     * This method will be called by the indexer script.
28     * some scoring method may want to normalize values based index size
29     *
30     * @param int $maxDocs the total number of docs in the index
31     */
32    public function setMaxDocs( $maxDocs );
33
34    /**
35     * Explain the score
36     * @param array $doc
37     * @return array
38     */
39    public function explain( array $doc );
40}