class ProjectionRepositoryImpl implements ProjectionRepository, Constants {

    public Map<String, Long> getAssetDetailsByApplication(String assetGroup, String resourceType) throws DataException {

        Map<String, Object> mustFilter = new HashMap<>();
        mustFilter.put(LATEST, true);

        if (resourceType.equals(ONPREMSERVER)) {
            mustFilter.put(CommonUtils.convertAttributetoKeyword(INSCOPE), true);
        }

        String aggsFilterApp = CommonUtils.convertAttributetoKeyword(TAGS_APPLICATION);

        try {

            return esRepository.getTotalDistributionForIndexAndType(assetGroup, resourceType, mustFilter, null, null,
                    aggsFilterApp, TEN_THOUSAND, null);
        } catch (Exception e) {
            logger.error(e);
            throw new DataException(e);
        }

    }

}