class ElasticSearchRepository implements Constants {

	@SuppressWarnings("unchecked")
	@Deprecated
	public List<Map<String, Object>> getDataFromES(String dataSource, String targetType, Map<String, Object> mustFilter,
			final Map<String, Object> mustNotFilter, final HashMultimap<String, Object> shouldFilter,
			List<String> fields, Map<String, Object> mustTermsFilter) throws Exception {

		Long totalDocs = getTotalDocumentCountForIndexAndType(dataSource, targetType, mustFilter, mustNotFilter,
				shouldFilter, null, mustTermsFilter);
		// if filter is not null apply filter, this can be a multi value filter
		// also if from and size are -1 -1 send all the data back and do not
		// paginate
		StringBuilder urlToQueryBuffer = new StringBuilder(esUrl).append(FORWARD_SLASH).append(dataSource);
		if (!Strings.isNullOrEmpty(targetType)) {
			urlToQueryBuffer.append(FORWARD_SLASH).append(targetType);
		}
		urlToQueryBuffer.append(FORWARD_SLASH).append(_SEARCH);

		String urlToQuery = urlToQueryBuffer.toString();
		// paginate for breaking the response into smaller chunks
		Map<String, Object> requestBody = new HashMap<String, Object>();
		requestBody.put(SIZE, ES_PAGE_SIZE);
		if (totalDocs < ES_PAGE_SIZE) {
			requestBody.put(SIZE, totalDocs);
		}
		requestBody.put(QUERY, buildQuery(mustFilter, mustNotFilter, shouldFilter, null, mustTermsFilter,null));
		requestBody.put(_SOURCE, fields);
		Gson serializer = new GsonBuilder().disableHtmlEscaping().create();
		String request = serializer.toJson(requestBody);

		return prepareResultsUsingScroll(0, totalDocs, urlToQuery, request);
	}

}