Error handling to prevent breaking exceptions if Elasticsearch is unavailable