protected function getSolrSuggestions(SuggestQuery $suggestQuery) : array
    {
        $pageId = $this->tsfe->getRequestedId();
        $languageId = $this->tsfe->sys_language_uid;
        $solr = GeneralUtility::makeInstance(ConnectionManager::class)->getConnectionByPageId($pageId, $languageId);
        $search = GeneralUtility::makeInstance(Search::class, /** @scrutinizer ignore-type */ $solr);
        $response = $search->search($suggestQuery, 0, 0);

        $rawResponse = $response->getRawResponse();
        $results = json_decode($rawResponse);
        $suggestConfig = $this->typoScriptConfiguration->getObjectByPath('plugin.tx_solr.suggest.');
        $facetSuggestions = $results->facet_counts->facet_fields->{$suggestConfig['suggestField']};
        $facetSuggestions = ParsingUtil::getMapArrayFromFlatArray($facetSuggestions);

        return $facetSuggestions ?? [];
    }
protected function getSolrSuggestions(SuggestQuery $suggestQuery) : array
    {
        $pageId = $this->tsfe->getRequestedId();
        $languageId = $this->tsfe->sys_language_uid;
        $solr = GeneralUtility::makeInstance(ConnectionManager::class)->getConnectionByPageId($pageId, $languageId);
        $search = GeneralUtility::makeInstance(Search::class, /** @scrutinizer ignore-type */ $solr);
        $response = $search->search($suggestQuery, 0, 0);

        $rawResponse = $response->getRawResponse();
        $results = json_decode($rawResponse);
        $suggestConfig = $this->typoScriptConfiguration->getObjectByPath('plugin.tx_solr.suggest.');
        $facetSuggestions = $results->facet_counts->facet_fields->{$suggestConfig['suggestField']};
        $facetSuggestions = ParsingUtil::getMapArrayFromFlatArray($facetSuggestions);

        return $facetSuggestions ?? [];
    }
protected function getSolrSuggestions ( SuggestQuery $ suggestQuery ) : array { $ pageId = $ this -> tsfe -> getRequestedId ( ) ; $ languageId = $ this -> tsfe -> sys_language_uid ; $ solr = GeneralUtility :: makeInstance ( ConnectionManager :: class ) -> getConnectionByPageId ( $ pageId , $ languageId ) ; $ search = GeneralUtility :: makeInstance ( Search :: class , /** @scrutinizer ignore-type */ $ solr ) ; $ response = $ search -> search ( $ suggestQuery , 0 , 0 ) ; $ rawResponse = $ response -> getRawResponse ( ) ; $ results = json_decode ( $ rawResponse ) ; $ suggestConfig = $ this -> typoScriptConfiguration -> getObjectByPath ( 'plugin.tx_solr.suggest.' ) ; $ facetSuggestions = $ results -> facet_counts -> facet_fields -> { $ suggestConfig [ 'suggestField' ] } ; $ facetSuggestions = ParsingUtil :: getMapArrayFromFlatArray ( $ facetSuggestions ) ; return $ facetSuggestions ?? [ ] ; }
Retrieves the suggestions from the solr server.

@param SuggestQuery $suggestQuery
@return array
Retrieves the suggestions from the solr server .