https://bugzilla.wikimedia.org/show_bug.cgi?id=66879

--- Comment #1 from Sam Reed (reedy) <[email protected]> ---
From bug 46420

(In reply to Sam Reed (reedy) from comment #5)
> I guess the problem is that we're now using ElasticSearch to do the
> randomness.
> 
> Meaning the SQL query, and as such, the amended SQL query for
> Special:RandomRootPage isn't actually run...
> 
> 
> Transplanting something like the below into the extension would fix this
> issue
> 
>       /**
>        * Choose a random title.
>        * @return Title|null Title object (or null if nothing to choose from)
>        */
>       public function getRandomTitle() {
>               $row = $this->selectRandomPageFromDB( wfRandom() );
> 
>               /* If we picked a value that was higher than any in
>                * the DB, wrap around and select the page with the
>                * lowest value instead!  One might think this would
>                * skew the distribution, but in fact it won't cause
>                * any more bias than what the page_random scheme
>                * causes anyway.  Trust me, I'm a mathematician. :)
>                */
>               if ( !$row ) {
>                       $row = $this->selectRandomPageFromDB( "0" );
>               }
> 
>               if ( $row ) {
>                       return Title::makeTitleSafe( $row->page_namespace, 
> $row->page_title );
>               }
> 
>               return null;
>       }

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to