lib/Elastica/Query/FunctionScore.php
public function addRandomScoreFunction(
        int $seed,
        AbstractQuery $filter = null,
        float $weight = null,
        string $field = null
    ): self {
        $functionParams = [
            'seed' => $seed,
        ];

        if (null !== $field) {
            $functionParams['field'] = $field;
        }

        return $this->addFunction('random_score', $functionParams, $filter, $weight);
    }
public function addRandomScoreFunction(
        int $seed,
        AbstractQuery $filter = null,
        float $weight = null,
        string $field = null
    ): self {
        $functionParams = [
            'seed' => $seed,
        ];

        if (null !== $field) {
            $functionParams['field'] = $field;
        }

        return $this->addFunction('random_score', $functionParams, $filter, $weight);
    }
public function addRandomScoreFunction ( int $ seed , AbstractQuery $ filter = null , float $ weight = null , string $ field = null ) : self { $ functionParams = [ 'seed' => $ seed , ] ; if ( null !== $ field ) { $ functionParams [ 'field' ] = $ field ; } return $ this -> addFunction ( 'random_score' , $ functionParams , $ filter , $ weight ) ; }
Add a random_score function to the query.

@param int           $seed   the seed value
@param AbstractQuery $filter a filter associated with this function
@param float         $weight an optional boost value associated with this function
@param string        $field  the field to be used for random number generation

@return $this
Add a random_score function to the query .