From 271e829f34f3632f87d8a818662f7c4c753037ff Mon Sep 17 00:00:00 2001
From: "michael.breu" <michael.breu@uibk.ac.at>
Date: Wed, 30 Jun 2021 13:05:10 +0200
Subject: [PATCH] Temporary Fix for statistics elastic search index

---
 .../uibk/gitsearch/service/impl/StatisticsServiceImpl.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main/java/at/ac/uibk/gitsearch/service/impl/StatisticsServiceImpl.java b/src/main/java/at/ac/uibk/gitsearch/service/impl/StatisticsServiceImpl.java
index db6924a31..4cb3c332e 100644
--- a/src/main/java/at/ac/uibk/gitsearch/service/impl/StatisticsServiceImpl.java
+++ b/src/main/java/at/ac/uibk/gitsearch/service/impl/StatisticsServiceImpl.java
@@ -45,7 +45,12 @@ public class StatisticsServiceImpl implements StatisticsService {
         Statistics statistics = statisticsMapper.toEntity(statisticsDTO);
         statistics = statisticsRepository.save(statistics);
         StatisticsDTO result = statisticsMapper.toDto(statistics);
-        statisticsSearchRepository.save(statistics);
+        // TODO temporary fix: statistics has a problem with complex exercise ids (e.g. 10:if1/exercise1) :-)
+        try {
+			statisticsSearchRepository.save(statistics);
+		} catch (Exception e) {
+			log.error("Please fix this problem! ExerciseIds are not numeric any more!", e);
+		}
         return result;
     }
 
-- 
GitLab