type = XContentMapValues.nodeStringValue(sourceClientSettings.get("type"), null);
if (Utils.isEmpty(type)) {
throw new SettingsException("es_connection/type element of configuration structure not found or empty");
}
if ("local".equalsIgnoreCase(type)) {
sourceClient = new SourceClientESClient(client);
} else if ("remote".equalsIgnoreCase(type)) {
sourceClient = new SourceClientESTransportClient(sourceClientSettings);
} else if ("rest".equalsIgnoreCase(type)) {
sourceClient = new SourceClientREST(sourceClientSettings);
} else {