public function didYouMean(ElasticSearchQueryResult $searchResult, float $scoreThreshold = 0.7, string $suggestionName = 'suggestions'): string
    {
        $maxScore = 0;
        $suggestionParts = [];

        foreach ($searchResult->getSuggestions()[$suggestionName] as $suggestion) {
            if (array_key_exists('options', $suggestion) && !empty($suggestion['options'])) {
                $bestSuggestion = current($suggestion['options']);
                $maxScore = $bestSuggestion['score'] > $maxScore ? $bestSuggestion['score'] : $maxScore;
                $suggestionParts[] = $bestSuggestion['text'];
            } else {
                $suggestionParts[] = $suggestion['text'];
            }
        }
        if ($maxScore >= $scoreThreshold) {
            return implode(' ', $suggestionParts);
        }

        return '';
    }