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);
    }