summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldIndexesValidator.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldIndexesValidator.java')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldIndexesValidator.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldIndexesValidator.java b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldIndexesValidator.java
index a18ce7e245d..fdd71ebccc5 100644
--- a/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldIndexesValidator.java
+++ b/config-model/src/main/java/com/yahoo/vespa/model/application/validation/ComplexFieldsWithStructFieldIndexesValidator.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.application.validation;
+import com.yahoo.config.application.api.DeployLogger;
import com.yahoo.config.model.deploy.DeployState;
import com.yahoo.schema.Schema;
import com.yahoo.schema.document.ImmutableSDField;
@@ -9,6 +10,7 @@ import com.yahoo.vespa.model.VespaModel;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import java.util.logging.Level;
import java.util.stream.Collectors;
/**
@@ -28,21 +30,22 @@ public class ComplexFieldsWithStructFieldIndexesValidator extends Validator {
continue;
}
for (var spec : cluster.schemas().values()) {
- validateComplexFields(cluster.getClusterName(), spec.fullSchema());
+ validateComplexFields(cluster.getClusterName(), spec.fullSchema(), deployState.getDeployLogger());
}
}
}
- private static void validateComplexFields(String clusterName, Schema schema) {
+ private static void validateComplexFields(String clusterName, Schema schema, DeployLogger logger) {
String unsupportedFields = schema.allFields()
.filter(field -> hasStructFieldsWithIndex(field))
.map(ComplexFieldsWithStructFieldIndexesValidator::toString)
.collect(Collectors.joining(", "));
if (!unsupportedFields.isEmpty()) {
- throw new IllegalArgumentException(
- String.format("For cluster '%s', schema '%s': The following complex fields have struct fields with 'indexing: index' which is not supported: %s. " +
- "Change to 'indexing: attribute' instead",
+ // TODO (Vespa 9 or before): Change back to an exception when no applications are using it wrong.
+ logger.logApplicationPackage(Level.WARNING,
+ String.format("For cluster '%s', schema '%s': The following complex fields have struct fields with 'indexing: index' which is not supported and has no effect: %s. " +
+ "Remove setting or change to 'indexing: attribute' if needed for matching.",
clusterName, schema.getName(), unsupportedFields));
}
}