Refactor and set elasticsearch server in config.js