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.

def setup_es(hosts, port, use_ssl=False, auth=None):
    """
    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.
    """
    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