class TrendRepositoryImpl implements TrendRepository, Constants {

    @Override
    public List<Map<String, Object>> getTrendIssues(String assetGroup,
            LocalDate startDate, LocalDate endDate, Map<String, String> filter,
            Set<String> ruleSev) throws DataException {
        String domain = filter.get(DOMAIN);
        List<String> severityList = new ArrayList<>(ruleSev);
        Map<String, Object> mustFilter = new HashMap<>();
        mustFilter.put(CommonUtils.convertAttributetoKeyword("ag"), assetGroup);
        mustFilter.put(CommonUtils.convertAttributetoKeyword(DOMAIN), domain);
        Map<String, Object> rangeMap = new HashMap<>();
        rangeMap.put("gte", startDate.format(DateTimeFormatter.ISO_DATE));
        rangeMap.put("lte", endDate.format(DateTimeFormatter.ISO_DATE));

        Map<String, Object> dateRangeMap = new HashMap<>();
        dateRangeMap.put("date", rangeMap);

        mustFilter.put(RANGE, dateRangeMap);
        severityList.add("date");
        severityList.add("total");
try{
        return elasticSearchRepository.getSortedDataFromES(AG_STATS, "issues",
                mustFilter, null, null, severityList, null,null);
}catch(Exception e){
    throw new DataException(e);
}
    }

}