public function createService()
    {
        $host = $this->getParameters()->get('host');
        $port = $this->getParameters()->get('port');
        $timeout = $this->getParameters()->get('timeout');

        if (is_null($host) || is_null($port)) {
            throw new \Exception(
                'No sphinx server information found within the configuration!'
            );
        }

        $sphinxClient = new SphinxClient();
        $sphinxClient->SetServer($host, $port);
        $sphinxClient->SetConnectTimeout($timeout);
        $sphinxClient->SetArrayResult(true);
        $sphinxClient->setMatchModeByModeName('any');
        $sphinxClient->SetSortMode(SPH_SORT_RELEVANCE);
        $sphinxClient->SetRankingMode(SPH_RANK_PROXIMITY);

        return $sphinxClient;
    }
public function createService()
    {
        $host = $this->getParameters()->get('host');
        $port = $this->getParameters()->get('port');
        $timeout = $this->getParameters()->get('timeout');

        if (is_null($host) || is_null($port)) {
            throw new \Exception(
                'No sphinx server information found within the configuration!'
            );
        }

        $sphinxClient = new SphinxClient();
        $sphinxClient->SetServer($host, $port);
        $sphinxClient->SetConnectTimeout($timeout);
        $sphinxClient->SetArrayResult(true);
        $sphinxClient->setMatchModeByModeName('any');
        $sphinxClient->SetSortMode(SPH_SORT_RELEVANCE);
        $sphinxClient->SetRankingMode(SPH_RANK_PROXIMITY);

        return $sphinxClient;
    }
public function createService ( ) { $ host = $ this -> getParameters ( ) -> get ( 'host' ) ; $ port = $ this -> getParameters ( ) -> get ( 'port' ) ; $ timeout = $ this -> getParameters ( ) -> get ( 'timeout' ) ; if ( is_null ( $ host ) || is_null ( $ port ) ) { throw new \ Exception ( 'No sphinx server information found within the configuration!' ) ; } $ sphinxClient = new SphinxClient ( ) ; $ sphinxClient -> SetServer ( $ host , $ port ) ; $ sphinxClient -> SetConnectTimeout ( $ timeout ) ; $ sphinxClient -> SetArrayResult ( true ) ; $ sphinxClient -> setMatchModeByModeName ( 'any' ) ; $ sphinxClient -> SetSortMode ( SPH_SORT_RELEVANCE ) ; $ sphinxClient -> SetRankingMode ( SPH_RANK_PROXIMITY ) ; return $ sphinxClient ; }
Factory e Configuracao padrao de um SphinxClient.

@return SphinxClient
Factory e Configuracao padrao de um SphinxClient .