@task
def restart_search():
    run("curl -XPOST 'http://localhost:9200/_shutdown'")
    if platform.linux_distribution()[0] == 'Ubuntu':
        run("sudo service elasticsearch restart")
    elif platform.system() == 'Darwin':  # Mac OSX
        run('elasticsearch')
Restarts Elasticsearch
dataset/ETHPy150Open CenterForOpenScience/scrapi/tasks.py/restart_search