class ElasticSearchRepository implements Constants {

	@SuppressWarnings("unchecked")
	public Boolean saveExceptionDataToES(String dataSource, String routing, Map<String, Object> data) {
		try {
			StringBuilder esQueryUrl = new StringBuilder(esUrl);
			if (!Strings.isNullOrEmpty(dataSource)) {
				esQueryUrl.append(FORWARD_SLASH).append(dataSource).append("/issue_").append(data.get(TARGET_TYPE))
						.append("_exception");
				if (!Strings.isNullOrEmpty(routing)) {
					esQueryUrl.append("?routing=").append(routing);
					Gson serializer = new GsonBuilder().create();
					String request = serializer.toJson(data);
					String responseDetails = PacHttpUtils.doHttpPost(esQueryUrl.toString(), request);
					Map<String, Object> response = (Map<String, Object>) serializer.fromJson(responseDetails,
							Object.class);
					if (response.get("result").toString().equalsIgnoreCase("created")) {
						return true;
					} else {
						return false;
					}
				}
			}
		} catch (Exception exception) {
			return false;
		}
		return false;
	}

}