protected function getSuggestionArray(SuggestQuery $suggestQuery, $solrSuggestions, $maxSuggestions) : array
    {
        $queryString = $suggestQuery->getQuery();
        $suggestionCount = 0;
        $suggestions = [];
        foreach ($solrSuggestions as $string => $count) {
            $suggestion = trim($queryString . ' ' . $string);
            $suggestions[$suggestion] = $count;
            $suggestionCount++;
            if ($suggestionCount === $maxSuggestions) {
                return $suggestions;
            }
        }

        return $suggestions;
    }
protected function getSuggestionArray(SuggestQuery $suggestQuery, $solrSuggestions, $maxSuggestions) : array
    {
        $queryString = $suggestQuery->getQuery();
        $suggestionCount = 0;
        $suggestions = [];
        foreach ($solrSuggestions as $string => $count) {
            $suggestion = trim($queryString . ' ' . $string);
            $suggestions[$suggestion] = $count;
            $suggestionCount++;
            if ($suggestionCount === $maxSuggestions) {
                return $suggestions;
            }
        }

        return $suggestions;
    }
protected function getSuggestionArray ( SuggestQuery $ suggestQuery , $ solrSuggestions , $ maxSuggestions ) : array { $ queryString = $ suggestQuery -> getQuery ( ) ; $ suggestionCount = 0 ; $ suggestions = [ ] ; foreach ( $ solrSuggestions as $ string => $ count ) { $ suggestion = trim ( $ queryString . ' ' . $ string ) ; $ suggestions [ $ suggestion ] = $ count ; $ suggestionCount ++ ; if ( $ suggestionCount === $ maxSuggestions ) { return $ suggestions ; } } return $ suggestions ; }
Extracts the suggestions from solr as array.

@param SuggestQuery $suggestQuery
@param array $solrSuggestions
@param integer $maxSuggestions
@return array
Extracts the suggestions from solr as array .