diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-02-26 16:41:25 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-02-26 16:41:25 +0100 |
commit | 174745d431c59bfd7d8077b817dc38090010fd35 (patch) | |
tree | 135c22a0f22cbdbdcf0b48bf8b9ea2c4c80d7eca /config-model/src/main/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypes.java | |
parent | 446dc287bf35768b73e1390df07a9462ae9db800 (diff) |
Don't validate when reloading models
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypes.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypes.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypes.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypes.java index 42fe58d2842..861ebad7085 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypes.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/processing/DisallowComplexMapAndWsetKeyTypes.java @@ -13,8 +13,8 @@ import com.yahoo.vespa.model.container.search.QueryProfiles; /** * Non-primitive key types for map and weighted set forbidden (though OK in document model) - * @author vegardh * + * @author Vegard Havdal */ public class DisallowComplexMapAndWsetKeyTypes extends Processor { @@ -23,17 +23,19 @@ public class DisallowComplexMapAndWsetKeyTypes extends Processor { } @Override - public void process() { + public void process(boolean validate) { + if ( ! validate) return; + // TODO also traverse struct types to search for bad map or wset types there. Do this after document manager is fixed, do // not start using the static stuff on SDDocumentTypes any more. for (SDField field : search.allConcreteFields()) { if (field.getDataType() instanceof WeightedSetDataType) { DataType nestedType = ((WeightedSetDataType)field.getDataType()).getNestedType(); - if (!(nestedType instanceof PrimitiveDataType)) { + if ( ! (nestedType instanceof PrimitiveDataType)) { fail(search, field, "Weighted set must have a primitive key type."); } } else if (field.getDataType() instanceof MapDataType) { - if (!(((MapDataType)field.getDataType()).getKeyType() instanceof PrimitiveDataType)) { + if ( ! (((MapDataType)field.getDataType()).getKeyType() instanceof PrimitiveDataType)) { fail(search, field, "Map key type must be a primitive type"); } } |