def get_es_client(silent=False):
    """
    Returns the elasticsearch client which uses the configuration file
    """
    es_client = Elasticsearch([settings.ELASTIC_SEARCH_HOST],
                              scheme='http',
                              port=9200,
                              http_compress=True)
    # test if it works
    if not silent and not es_client.cat.health(request_timeout=30):
        raise ValueError('Credentials do not work for Elastic search')
    return es_client