public function build($options = [])
    {
        $options       = array_merge($this->defaultOptions, $options);

        $clientBuilder = $this->clientBuilder->create();

        $hosts = $this->getHosts($options);

        if (!empty($hosts)) {
            $clientBuilder->setHosts($hosts);
        }

        if ($options['is_debug_mode_enabled']) {
            $clientBuilder->setLogger($this->logger);
            $clientBuilder->setTracer($this->logger);
        }

        return $clientBuilder->build();
    }
public function build($options = [])
    {
        $options       = array_merge($this->defaultOptions, $options);

        $clientBuilder = $this->clientBuilder->create();

        $hosts = $this->getHosts($options);

        if (!empty($hosts)) {
            $clientBuilder->setHosts($hosts);
        }

        if ($options['is_debug_mode_enabled']) {
            $clientBuilder->setLogger($this->logger);
            $clientBuilder->setTracer($this->logger);
        }

        return $clientBuilder->build();
    }
public function build ( $ options = [ ] ) { $ options = array_merge ( $ this -> defaultOptions , $ options ) ; $ clientBuilder = $ this -> clientBuilder -> create ( ) ; $ hosts = $ this -> getHosts ( $ options ) ; if ( ! empty ( $ hosts ) ) { $ clientBuilder -> setHosts ( $ hosts ) ; } if ( $ options [ 'is_debug_mode_enabled' ] ) { $ clientBuilder -> setLogger ( $ this -> logger ) ; $ clientBuilder -> setTracer ( $ this -> logger ) ; } return $ clientBuilder -> build ( ) ; }
Build an ES client from options.

@param array $options Client options. See self::defaultOptions for available options.

@return \Elasticsearch\Client
Build an ES client from options .