yii\elasticsearch\Connection::createUrl PHP Method

createUrl() private method

Creates URL
private createUrl ( string | array $path, array $options = [] ) : array
$path string | array path
$options array URL options
return array
    private function createUrl($path, $options = [])
    {
        if (!is_string($path)) {
            $url = implode('/', array_map(function ($a) {
                return urlencode(is_array($a) ? implode(',', $a) : $a);
            }, $path));
            if (!empty($options)) {
                $url .= '?' . http_build_query($options);
            }
        } else {
            $url = $path;
            if (!empty($options)) {
                $url .= (strpos($url, '?') === false ? '?' : '&') . http_build_query($options);
            }
        }
        $node = $this->nodes[$this->activeNode];
        $protocol = isset($node['protocol']) ? $node['protocol'] : $this->defaultProtocol;
        $host = $node['http_address'];
        return [$protocol, $host, $url];
    }