6865 fix alternate filter use for domains

This commit is contained in:
William Schaefer 2020-09-21 13:57:11 -04:00
parent 7c652b384c
commit 0f0f7022b7

View File

@ -59,7 +59,9 @@ class DomainSearchCacheLoader extends CacheLoader<SearchKey, Map<GroupKey, List<
public Map<GroupKey, List<Result>> load(SearchKey key) throws DiscoveryException, SQLException, TskCoreException { public Map<GroupKey, List<Result>> load(SearchKey key) throws DiscoveryException, SQLException, TskCoreException {
List<Result> domainResults = getResultDomainsFromDatabase(key); List<Result> domainResults = getResultDomainsFromDatabase(key);
//manually add the attributes for filters which use alternate non filters and could be used by grouping or sorting
DiscoveryAttributes.FrequencyAttribute freqAttr = new DiscoveryAttributes.FrequencyAttribute();
freqAttr.addAttributeToResults(domainResults, key.getSleuthkitCase(), key.getCentralRepository());
// Apply secondary in memory filters // Apply secondary in memory filters
for (AbstractFilter filter : key.getFilters()) { for (AbstractFilter filter : key.getFilters()) {
if (filter.useAlternateFilter()) { if (filter.useAlternateFilter()) {
@ -245,10 +247,12 @@ class DomainSearchCacheLoader extends CacheLoader<SearchKey, Map<GroupKey, List<
private SQLException sqlCause; private SQLException sqlCause;
private TskCoreException coreCause; private TskCoreException coreCause;
private final Set<String> bannedDomains = new HashSet<String>() {{ private final Set<String> bannedDomains = new HashSet<String>() {
add("localhost"); {
add("127.0.0.1"); add("localhost");
}}; add("127.0.0.1");
}
};
/** /**
* Construct a new DomainCallback object. * Construct a new DomainCallback object.