As a cirrus developer i would like the actual score the explain score to be the same so i have accurate debugging information when investigating problems.
Initial failure was in 628938 (ci logs).
Reproduction from shell.php:
>>> $page = [
... 'incoming_links' => 77,
... 'external_link' => null,
... 'text_bytes' => 172086,
... 'heading' => null,
... 'redirect' => null,
... 'popularity_score' => 0.0010121457489879,
... 'templates' => [ 'Good' ],
... ]
=> [
"incoming_links" => 77,
"external_link" => null,
"text_bytes" => 172086,
"heading" => null,
"redirect" => null,
"popularity_score" => 0.0010121457489879,
"templates" => [
"Good",
],
]
>>> $scorer = new CirrusSearch\BuildDocument\Completion\PQScore(['Good' => 2, 'Bad' => 0.5]);
=> CirrusSearch\BuildDocument\Completion\PQScore {#2565}
>>> $scorer->score($page)
=> 7402597
>>> $scorer->explain($page)['value']
=> 4545454