src/Query/Compound/FunctionScoreQuery.php
public function addRandomFunction($seed = null, BuilderInterface $query = null)
    {
        $function = [
            'random_score' => $seed ? [ 'seed' => $seed ] : new \stdClass(),
        ];

        $this->applyFilter($function, $query);

        $this->functions[] = $function;

        return $this;
    }
public function addRandomFunction($seed = null, BuilderInterface $query = null)
    {
        $function = [
            'random_score' => $seed ? [ 'seed' => $seed ] : new \stdClass(),
        ];

        $this->applyFilter($function, $query);

        $this->functions[] = $function;

        return $this;
    }
public function addRandomFunction ( $ seed = null , BuilderInterface $ query = null ) { $ function = [ 'random_score' => $ seed ? [ 'seed' => $ seed ] : new \ stdClass ( ) , ] ; $ this -> applyFilter ( $ function , $ query ) ; $ this -> functions [ ] = $ function ; return $ this ; }
Adds random score function. Seed is optional.

@param mixed            $seed
@param BuilderInterface $query

@return $this
Adds random score function . Seed is optional .