code: def setup_es(hosts, port, use_ssl=False, auth=None):
      
      kwargs = dict(
          hosts=hosts or ['localhost'],
          port=port or 9200,
          use_ssl=use_ssl,
      )
      if auth:
          kwargs.update(http_auth=auth)
  
      CLIENT = Elasticsearch(**kwargs)
      S = Search(using=CLIENT, index="geonames")
      return S
docs: Setup an Elasticsearch connection
  
      Parameters
      ----------
      hosts: list
              Hostnames / IP addresses for elasticsearch cluster
      port: string
              Port for elasticsearch cluster
      use_ssl: boolean
              Whether to use SSL for the elasticsearch connection
      auth: tuple
              (username, password) to use with HTTP auth
      Returns
      -------
      es_conn: an elasticsearch_dsl Search connection object.