change elasticsearchfatory for reconnection