Skip to content

Commit

Permalink
sepinf-inc#2286: don't duplicate "xxx:count" metadata in report gener…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
aberenguel committed Sep 4, 2024
1 parent b6444dc commit cd9276b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import java.util.TreeSet;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;
import org.apache.lucene.document.BinaryDocValuesField;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.DoubleDocValuesField;
Expand Down Expand Up @@ -697,6 +698,11 @@ private static void addMetadataKeyToDoc(Document doc, String key, String value,
if (type == null && MetadataUtil.isHtmlMediaType(mimetype) && !key.startsWith(ExtraProperties.UFED_META_PREFIX))
return;

// don't add in report generation (it will be calculated again)
if (key.endsWith(":count") && countMetadata.contains(StringUtils.substringBeforeLast(key, ":count"))) {
return;
}

if (type == null) {
try {
Double doubleVal = Double.valueOf(value);
Expand Down

0 comments on commit cd9276b

Please sign in to comment.