Commit 2fcdab85 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix issue with field name.

parent 9776628b
...@@ -350,9 +350,9 @@ class DocumentsSearchDocBuilder( ...@@ -350,9 +350,9 @@ class DocumentsSearchDocBuilder(
.flatMap { it.toList() }, .flatMap { it.toList() },
callNumber = Extract.typedEntityByType(physicalIdentifiers, "type", "callNumber", "identifier") callNumber = Extract.typedEntityByType(physicalIdentifiers, "type", "callNumber", "identifier")
.flatMap { it.toList() }, .flatMap { it.toList() },
accessInstitution = elasticSearchWrapper.getExtraInstitutionsFromRecordSet(recordSetId, "access"), accessInstitution = elasticSearchWrapper.getExtraInstitutionsFromRecordSet(recordSetId, "accessInstitution"),
originalInstitution = elasticSearchWrapper.getExtraInstitutionsFromRecordSet(recordSetId, "original"), originalInstitution = elasticSearchWrapper.getExtraInstitutionsFromRecordSet(recordSetId, "originalInstitution"),
masterInstitution = elasticSearchWrapper.getExtraInstitutionsFromRecordSet(recordSetId, "master"), masterInstitution = elasticSearchWrapper.getExtraInstitutionsFromRecordSet(recordSetId, "masterInstitution"),
published = (record[Constants.isPublished] as Boolean?) ?: false, published = (record[Constants.isPublished] as Boolean?) ?: false,
suggest = suggestContainerBuilder.build()[0] suggest = suggestContainerBuilder.build()[0]
......
...@@ -230,21 +230,21 @@ class ElasticSearchWrapper( ...@@ -230,21 +230,21 @@ class ElasticSearchWrapper(
val request = GetRequest(recordSetIndex, identifier) val request = GetRequest(recordSetIndex, identifier)
val response = client.get(request, RequestOptions.DEFAULT) val response = client.get(request, RequestOptions.DEFAULT)
if (response.isExists) { if (response.isExists) {
when (val map = response.sourceAsMap["${extraType}Institution"]) { when (val map = response.sourceAsMap[extraType]) {
is List<*> -> { is List<*> -> {
log.debug("Retrieval of '${extraType}Institution' was successful.") log.debug("Retrieval of '$extraType' was successful.")
map.map { FacetContainer.fromMap(it) } map.map { FacetContainer.fromMap(it) }
} }
null -> { null -> {
log.error("Found record set for id $identifier in $recordSetIndex, but could not retrieve names in field '${extraType}Institution'.") log.error("Found record set for id $identifier in $recordSetIndex, but could not retrieve names in field '$extraType'.")
emptyList() emptyList()
} }
is Map<*, *> -> { is Map<*, *> -> {
log.debug("Retrieval of '${extraType}Institution' was successful.") log.debug("Retrieval of '$extraType' was successful.")
listOf(FacetContainer.fromMap(map)) listOf(FacetContainer.fromMap(map))
} }
else -> { else -> {
log.error("Found record set for id $identifier in $recordSetIndex, but could not retrieve names in field '${extraType}Institution'.") log.error("Found record set for id $identifier in $recordSetIndex, but could not retrieve names in field '$extraType'.")
emptyList() emptyList()
} }
} }
......
Markdown is supported
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