class PatchingRepositoryImpl implements PatchingRepository, Constants {

    @Override
    public long getInstanceInfoCount(String assetGroup,
            Map<String, String> filters, String searchText) throws DataException {

        Map<String, Object> mustFilter = new HashMap<>();
        mustFilter.put(LATEST, true);
        mustFilter.put(STATE_NAME, RUNNING);
        Map<String, Object> mustNotFilter = new HashMap<>();
        mustNotFilter.put(PLATFORM, WINDOWS);

        if (null != filters && filters.size() > 0) {
            filters.forEach((key, value) -> mustFilter.put(key, value));
        }
        try{
        return elasticSearchRepository.getTotalDocumentCountForIndexAndType(
                assetGroup, "ec2", mustFilter, mustNotFilter, null, searchText,
                null);
        } catch(Exception e){
            throw new DataException(e);
        }
    }

}