code: def _Connect(self):
      
      elastic_host = {'host': self._host, 'port': self._port}
  
      if self._url_prefix:
        elastic_host['url_prefix'] = self._url_prefix
  
      elastic_http_auth = None
      if self._username is not None:
        elastic_http_auth = (self._username, self._password)
  
      self._client = elasticsearch.Elasticsearch(
          [elastic_host],
          http_auth=elastic_http_auth,
          use_ssl=self._use_ssl,
          ca_certs=self._ca_certs
      )
  
      logger.debug(
          ('Connected to Elasticsearch server: {0:s} port: {1:d}'
           'URL prefix {2!s}.').format(self._host, self._port, self._url_prefix))
docs: Connects to an Elasticsearch server.