CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Score that tries to reflect the quality of a page. More...
Public Member Functions | |
__construct ( $boostTemplates=null) | |
score (array $doc) | |
@inheritDoc | |
scoreNormLog2 ( $value, $norm) | |
log2( ( value / norm ) + 1 ) => [0-1] | |
scoreNorm ( $value, $norm) | |
value / norm => [0-1] | |
boostTemplates (array $doc, $score) | |
Modify an existing score based on templates contained by the document. | |
boost ( $score, $boost) | |
Boost the score : boost value lower than 1 will decrease the score boost value set to 1 will keep the score unchanged boost value greater than 1 will increase the score. | |
getRequiredFields () | |
@inheritDoc | |
setMaxDocs ( $maxDocs) | |
explain (array $doc) | |
Explain the score. | |
Public Attributes | |
const | INCOMING_LINKS_MAX_DOCS_FACTOR = 0.1 |
const | EXTERNAL_LINKS_NORM = 20 |
const | PAGE_SIZE_NORM = 50000 |
const | HEADING_NORM = 20 |
const | REDIRECT_NORM = 30 |
const | SCORE_RANGE = 10000000 |
Protected Member Functions | |
intermediateScore (array $doc) | |
intermediateExplain (array $doc) | |
explainWeight (array $detail, $weight, $allWeights, $valueName) | |
Protected Attributes | |
$maxDocs | |
Score that tries to reflect the quality of a page.
NOTE: Experimental
This score makes the assumption that bigger is better.
Small cities/village which have a high number of incoming links because they link to each others ( see https://en.wikipedia.org/wiki/Villefort,_Loz%C3%A8re ) will be be discounted correctly because others variables are very low.
On the other hand some pages like List will get sometimes a very high but unjustified score.
The boost templates feature might help but it's a System message that is not necessarily configured by wiki admins.
CirrusSearch\BuildDocument\Completion\QualityScore::__construct | ( | $boostTemplates = null | ) |
float[] | null | $boostTemplates | Array of key values, key is the template name, value the boost factor. Defaults to Util::getDefaultBoostTemplates() |
CirrusSearch\BuildDocument\Completion\QualityScore::boost | ( | $score, | |
$boost ) |
Boost the score : boost value lower than 1 will decrease the score boost value set to 1 will keep the score unchanged boost value greater than 1 will increase the score.
score = 0.5, boost = 0.5 result is 0.375 score = 0.1, boost = 2 result is 0.325
float | $score | |
float | $boost |
CirrusSearch\BuildDocument\Completion\QualityScore::boostTemplates | ( | array | $doc, |
$score ) |
Modify an existing score based on templates contained by the document.
array | $doc | Document score is generated for |
float | $score | Current score between 0 and 1 |
CirrusSearch\BuildDocument\Completion\QualityScore::explain | ( | array | $doc | ) |
Explain the score.
array | $doc |
Implements CirrusSearch\BuildDocument\Completion\SuggestScoringMethod.
Reimplemented in CirrusSearch\BuildDocument\Completion\PQScore.
|
protected |
array | $detail | |
float | $weight | |
float | $allWeights | |
string | $valueName |
CirrusSearch\BuildDocument\Completion\QualityScore::getRequiredFields | ( | ) |
@inheritDoc
Implements CirrusSearch\BuildDocument\Completion\SuggestScoringMethod.
Reimplemented in CirrusSearch\BuildDocument\Completion\PQScore.
|
protected |
array | $doc |
CirrusSearch\BuildDocument\Completion\QualityScore::score | ( | array | $doc | ) |
@inheritDoc
Implements CirrusSearch\BuildDocument\Completion\SuggestScoringMethod.
Reimplemented in CirrusSearch\BuildDocument\Completion\PQScore.
CirrusSearch\BuildDocument\Completion\QualityScore::scoreNorm | ( | $value, | |
$norm ) |
value / norm => [0-1]
float | $value | |
float | $norm |
CirrusSearch\BuildDocument\Completion\QualityScore::scoreNormLog2 | ( | $value, | |
$norm ) |
log2( ( value / norm ) + 1 ) => [0-1]
float | $value | |
float | $norm |
CirrusSearch\BuildDocument\Completion\QualityScore::setMaxDocs | ( | $maxDocs | ) |
int | $maxDocs |
Implements CirrusSearch\BuildDocument\Completion\SuggestScoringMethod.