diff --git a/src/main/kotlin/no/fdk/concept_catalog/elastic/ElasticUpdater.kt b/src/main/kotlin/no/fdk/concept_catalog/elastic/ElasticUpdater.kt index a4c378c9..475c41d4 100644 --- a/src/main/kotlin/no/fdk/concept_catalog/elastic/ElasticUpdater.kt +++ b/src/main/kotlin/no/fdk/concept_catalog/elastic/ElasticUpdater.kt @@ -21,12 +21,18 @@ class ElasticUpdater( fun reindexElastic() = runBlocking { launch { try { + logger.info("deleting all current concepts") currentConceptRepository.deleteAll() } catch (_: Exception) { } conceptRepository.findAll() .forEach { - if (it.shouldBeCurrent(currentConceptRepository.findByIdOrNull(it.originaltBegrep))) currentConceptRepository.save(CurrentConcept(it)) + if (it.shouldBeCurrent(currentConceptRepository.findByIdOrNull(it.originaltBegrep))) { + logger.info("reindexing ${it.id}") + currentConceptRepository.save(CurrentConcept(it)) + } else { + logger.info("skipping not current ${it.id}") + } } logger.info("finished reindexing elastic")