Commit 151fb681 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix json array data extraction

If the array is just string then return strings!
parent 52cf37a4
Pipeline #10673 failed with stages
in 1 minute and 51 seconds
......@@ -103,10 +103,13 @@ class SearchDocTransform(mapping: String) {
is JsonObject ->
Pair(targetField, mapOf(Pair(value["@language"], value["@value"])))
is JsonArray<*> ->
Pair(targetField, value.map {
it as JsonObject
Pair(it["@language"], it["@value"])
}.toMap())
Pair(targetField, value.mapNotNull {
when (it) {
is String -> it
is JsonObject -> Pair(it["@language"], it["@value"])
else -> null
}
})
else -> {
log.error("Could not parse literal value: $value.")
null
......
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