Commit 52c6597a authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Add institution to updates. So we can have list of institutions in documents.

parent 1ad8a776
Pipeline #25080 passed with stages
in 4 minutes and 55 seconds
......@@ -169,10 +169,6 @@ class KafkaTopology(
schema
.map { key, value ->
when (value) {
is InstitutionSearchDoc -> KeyValue(
"$key#update",
updateQueryBuilder.updateInstitutionName(value.id, value.name)
)
is RecordSetSearchDoc -> KeyValue(
"$key#update",
updateQueryBuilder.updateRecordSetName(value.id, value.name)
......@@ -184,10 +180,10 @@ class KafkaTopology(
.mapValues { value -> JsonUtility.queryToJson(value!!) }
.to(updateTopic)
recordSetUpdate(schema, "masterInstitution")
recordSetUpdate(schema, "originalInstitution")
recordSetUpdate(schema, "accessInstitution")
recordSetUpdate(schema, "institution")
}
......@@ -208,6 +204,11 @@ class KafkaTopology(
private fun updateInstitutionContainer(recordSet: RecordSetSearchDoc, targetField: String): UpdateQuery {
return when (targetField) {
"institution" -> updateQueryBuilder.updateInstitutionContainers(
recordSet.id,
targetField,
recordSet.institution
)
"masterInstitution" -> updateQueryBuilder.updateInstitutionContainers(
recordSet.id,
targetField,
......
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