public function getElasticSearchClient()
    {
        $config = $this->getElasticConfig();

        // elasticsearch v2.0 using builder
        if (class_exists('\Elasticsearch\ClientBuilder')) {
            return \Elasticsearch\ClientBuilder::fromConfig($config);
        }

        // elasticsearch v1
        return new \Elasticsearch\Client($config);
    }
public function getElasticSearchClient()
    {
        $config = $this->getElasticConfig();

        // elasticsearch v2.0 using builder
        if (class_exists('\Elasticsearch\ClientBuilder')) {
            return \Elasticsearch\ClientBuilder::fromConfig($config);
        }

        // elasticsearch v1
        return new \Elasticsearch\Client($config);
    }
public function getElasticSearchClient ( ) { $ config = $ this -> getElasticConfig ( ) ; // elasticsearch v2.0 using builder if ( class_exists ( '\Elasticsearch\ClientBuilder' ) ) { return \ Elasticsearch \ ClientBuilder :: fromConfig ( $ config ) ; } // elasticsearch v1 return new \ Elasticsearch \ Client ( $ config ) ; }
Get ElasticSearch Client

@return \Elasticsearch\Client
Get ElasticSearch Client