diff options
author | Geir Storli <geirst@verizonmedia.com> | 2021-10-01 12:56:19 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2021-10-01 14:22:42 +0000 |
commit | 3b28877e3f8492df65051c1e6f9d85c6a65a8378 (patch) | |
tree | e18b87312df71eafdf18900105d657326cf90523 /config-model/src/main/java/com | |
parent | e5bb53bb99168c5909c3db1c74f096c5ba57409a (diff) |
Do not replace existing struct fields when populating a field.
This fixes a problem where a type inheriting another type would replace (and remove)
the struct field attributes (of complex fields) of the base type.
This made it impossible to import the base complex field (using parent/child) as the struct field attributes no longer existed.
Diffstat (limited to 'config-model/src/main/java/com')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java index 02df81fbbb3..4d553054aaf 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/document/SDField.java @@ -293,7 +293,7 @@ public class SDField extends Field implements TypedKey, FieldOperationContainer, for (Field field : subType.fieldSet()) { SDField subField = new SDField(sdoc, name.concat(".").concat(field.getName()), field.getDataType(), subType, new Matching(), true, recursion + 1); - structFields.put(field.getName(), subField); + structFields.putIfAbsent(field.getName(), subField); } } } |