fix(elasticsearch): added controlled shutdown