class ElasticSearchRepository implements Constants {

	@SuppressWarnings("unchecked")
	public Boolean updatePartialDataToES(String dataSource, String targetType, String id, String routing, String parent,
			Map<String, Object> partialDocument) throws Exception {
		try {
			StringBuilder esQueryUrl = new StringBuilder(esUrl);
			if (!Strings.isNullOrEmpty(dataSource) && !Strings.isNullOrEmpty(targetType)) {
				esQueryUrl.append(FORWARD_SLASH).append(dataSource).append(FORWARD_SLASH).append(targetType);
				esQueryUrl.append(FORWARD_SLASH).append(id).append(FORWARD_SLASH).append("_update");
				if (!Strings.isNullOrEmpty(routing) && !Strings.isNullOrEmpty(parent)) {
					esQueryUrl.append("?routing=").append(routing).append("&parent=").append(parent);
				}
				Map<String, Object> documentToUpdate = Maps.newHashMap();
				documentToUpdate.put("doc", partialDocument);
				Gson serializer = new GsonBuilder().create();
				String request = serializer.toJson(documentToUpdate);
				String responseDetails = PacHttpUtils.doHttpPost(esQueryUrl.toString(), request);
				Map<String, Object> response = (Map<String, Object>) serializer.fromJson(responseDetails, Object.class);
				return ("updated".equalsIgnoreCase(response.get("result").toString())
						|| "noop".equalsIgnoreCase(response.get("result").toString()));
			}
		} catch (Exception exception) {
			LOGGER.error("error while updatePartialDataToES",exception);
			return false;
		}
		return false;
	}

}