class TaggingRepositoryImpl implements TaggingRepository, Constants {

    public Long getUntaggedIssues(String assetGroup, String mandatoryTag)
            throws DataException {
        Map<String, Object> mustFilter = new HashMap<>();
        Map<String, Object> mustNotFilter = new HashMap<>();
        Map<String, Object> mustTermsFilter = new HashMap<>();
        HashMultimap<String, Object> shouldFilter = HashMultimap.create();
        Map<String, List<String>> matchPhrasePrefix = new HashMap<>();
        List<String> mandatoryTagsList = new ArrayList<>();
        if (mandatoryTag != null) {
            mandatoryTagsList.add(mandatoryTag);
        }
        mustFilter.put(CommonUtils.convertAttributetoKeyword(TYPE), ISSUE);
        mustFilter.put(CommonUtils.convertAttributetoKeyword(POLICYID),
                TAGGIG_POLICY);
        matchPhrasePrefix.put(MISSING_TAGS, mandatoryTagsList);
        shouldFilter.put(CommonUtils.convertAttributetoKeyword(ISSUE_STATUS),
                OPEN);
        try{
        return elasticSearchRepository
                .getTotalDistributionForIndexAndTypeWithMatchPhrase(assetGroup,
                        null, mustFilter, mustNotFilter, shouldFilter, null,
                        mustTermsFilter, matchPhrasePrefix);
        } catch (Exception e) {
            throw new DataException(e);
        }
    }

}