Commit 16c1f304 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Use kotlin construct sumOf

parent aee85cd0
Pipeline #54514 passed with stages
in 3 minutes and 34 seconds
......@@ -112,12 +112,12 @@ class InstitutionSearchDocBuilder(
address = addresses,
postalCodes = postalCodes,
numberOfRecordSets = recordSetIds.count(),
numberOfDocuments = recordSetIds
.map { value -> elasticSearchWrapper.countTotalNumberOfDocuments(value) }
.sum(),
numberOfDocumentsPublished = recordSetIds
.map { value -> elasticSearchWrapper.countNumberOfDocumentsPublished(value) }
.sum(),
numberOfDocuments = recordSetIds.sumOf { value -> elasticSearchWrapper.countTotalNumberOfDocuments(value) },
numberOfDocumentsPublished = recordSetIds.sumOf { value ->
elasticSearchWrapper.countNumberOfDocumentsPublished(
value
)
},
teaserColor = institution[MB.institutionTeaserColor.localName].let {
if (it == null) {
log.warn("No teaser colour found for institution $id.")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment