diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDynamicStructsArrays.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDynamicStructsArrays.java | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDynamicStructsArrays.java b/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDynamicStructsArrays.java deleted file mode 100644 index c350c6800ed..00000000000 --- a/config-model/src/main/java/com/yahoo/searchdefinition/processing/SummaryDynamicStructsArrays.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.searchdefinition.processing; - - -import com.yahoo.config.application.api.DeployLogger; -import com.yahoo.searchdefinition.RankProfileRegistry; -import com.yahoo.document.*; -import com.yahoo.searchdefinition.Schema; -import com.yahoo.searchdefinition.document.SDField; -import com.yahoo.vespa.documentmodel.SummaryField; -import com.yahoo.vespa.documentmodel.SummaryTransform; -import com.yahoo.vespa.model.container.search.QueryProfiles; - -/** - * Fail if: - * An SD field explicitly says summary:dynamic , but the field is wset, array or struct. - * If there is an explicitly defined summary class, saying dynamic in one of its summary - * fields is always legal. - * - * @author Vegard Havdal - */ -public class SummaryDynamicStructsArrays extends Processor { - - public SummaryDynamicStructsArrays(Schema schema, DeployLogger deployLogger, RankProfileRegistry rankProfileRegistry, QueryProfiles queryProfiles) { - super(schema, deployLogger, rankProfileRegistry, queryProfiles); - } - - @Override - public void process(boolean validate, boolean documentsOnly) { - if ( ! validate) return; - - for (SDField field : schema.allConcreteFields()) { - DataType type = field.getDataType(); - if (type instanceof ArrayDataType || type instanceof WeightedSetDataType || type instanceof StructDataType) { - for (SummaryField sField : field.getSummaryFields().values()) { - if (sField.getTransform().equals(SummaryTransform.DYNAMICTEASER)) { - throw new IllegalArgumentException("For field '"+field.getName()+"': dynamic summary is illegal " + - "for fields of type struct, array or weighted set. Use an " + - "explicit summary class with explicit summary fields sourcing" + - " from the array/struct/weighted set."); - } - } - } - } - } - -} |