class ESManager implements Constants {

     public static void configureIndexAndTypes(String ds, List<Map<String, String>> errorList) {

        String _payLoad = "{\"settings\" : { \"number_of_shards\" : 3,\"number_of_replicas\" : 1 },\"mappings\": {";

        Set<String> types = ConfigManager.getTypes(ds);
        Iterator<String> it = types.iterator();
        while (it.hasNext()) {
            String _type = it.next();
            String indexName = ds+ "_" + _type;
            if (!indexExists(indexName)) {
                StringBuilder payLoad = new StringBuilder(_payLoad);
                payLoad.append("\"" + _type + "\":{},\"issue_" + _type + "\": { \"_parent\": {\"type\": \"" + _type
                        + "\"}},\"issue_" + _type + "_audit\": { \"_parent\": {\"type\": \"issue_" + _type
                        + "\"}},\"issue_" + _type + "_comment\": { \"_parent\": {\"type\": \"issue_" + _type
                        + "\"}},\"issue_" + _type + "_exception\": { \"_parent\": {\"type\": \"issue_" + _type
                        + "\"}}");
                payLoad.append("}}");
                try {
                    invokeAPI("PUT", indexName, payLoad.toString());
                } catch (IOException e) {
                    LOGGER.error("Error in configureIndexAndTypes",e);
                    Map<String,String> errorMap = new HashMap<>();
                    errorMap.put(ERROR, "Error in configureIndexAndTypes");
                    errorMap.put(ERROR_TYPE, WARN);
                    errorMap.put(EXCEPTION, e.getMessage());
                    errorList.add(errorMap);
                }
            }
            try {
				invokeAPI("PUT", "/" + indexName + "/_alias/" + ds, null);
				invokeAPI("PUT", "/" + indexName + "/_alias/" + "ds-all", null);
			} catch (IOException e) {
				
			}
        }
     }

}