diff options
author | Harald Musum <musum@verizonmedia.com> | 2021-02-21 15:41:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-21 15:41:58 +0100 |
commit | 3e398eaf1db5847602f54cac33bf3c76718631fa (patch) | |
tree | 6ec150eb24c633d276240d1963110004772eb546 /config-model/src/main/java/com/yahoo/searchdefinition/derived/validation | |
parent | acb1d037c128ca0c35029923d1ec9777d4e26d92 (diff) | |
parent | e5852de9c3fcfd5714aa20512014e1524338c844 (diff) |
Merge pull request #16612 from vespa-engine/bratseth/non-functional-changes-37
Non-functional changes only
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/derived/validation')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/derived/validation/IndexStructureValidator.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/derived/validation/IndexStructureValidator.java b/config-model/src/main/java/com/yahoo/searchdefinition/derived/validation/IndexStructureValidator.java index b09f85726e5..10385e826f2 100644 --- a/config-model/src/main/java/com/yahoo/searchdefinition/derived/validation/IndexStructureValidator.java +++ b/config-model/src/main/java/com/yahoo/searchdefinition/derived/validation/IndexStructureValidator.java @@ -10,7 +10,7 @@ import com.yahoo.vespa.indexinglanguage.expressions.Expression; import com.yahoo.vespa.indexinglanguage.expressions.OutputExpression; /** - * @author <a href="mailto:mlidal@yahoo-inc.com">Mathias M Lidal</a> + * @author Mathias M Lidal */ public class IndexStructureValidator extends Validator { @@ -37,15 +37,14 @@ public class IndexStructureValidator extends Validator { @Override protected void doVisit(Expression exp) { - if (!(exp instanceof OutputExpression)) { - return; - } + if (!(exp instanceof OutputExpression)) return; + String fieldName = ((OutputExpression)exp).getFieldName(); - if (docType.getField(fieldName) != null) { - return; - } + if (docType.getField(fieldName) != null) return; + throw new IllegalArgumentException("Indexing expression '" + this.exp + "' refers to field '" + fieldName + "' which does not exist in the index structure."); } } + } |