diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfig.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfig.java index e3f6b0be735..175f3108e35 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfig.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfig.java @@ -36,6 +36,7 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import java.util.stream.Collectors; + /** * Autodetect analysis configuration options describes which fields are * analysed and the functions to use. @@ -557,7 +558,6 @@ public class AnalysisConfig implements ToXContentObject, Writeable { } verifyNoInconsistentNestedFieldNames(); - verifyInfluencerNames(); return new AnalysisConfig(bucketSpan, categorizationFieldName, categorizationFilters, latency, summaryCountFieldName, detectors, influencers, overlappingBuckets, @@ -675,17 +675,6 @@ public class AnalysisConfig implements ToXContentObject, Writeable { } } - private void verifyInfluencerNames() { - for (String influencer : influencers) { - if (influencer == null || influencer.isEmpty()) { - throw ExceptionsHelper.badRequestException( - Messages.getMessage(Messages.JOB_CONFIG_INFLUENCER_CANNOT_BE_EMPTY)); - } - - Detector.Builder.verifyFieldName(influencer); - } - } - private static void checkDetectorsHavePartitionFields(List detectors) { for (Detector detector : detectors) { if (!Strings.isNullOrEmpty(detector.getPartitionFieldName())) { diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java index 140ad637865..2187b6d7962 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/messages/Messages.java @@ -112,11 +112,10 @@ public final class Messages { public static final String JOB_CONFIG_FUNCTION_REQUIRES_OVERFIELD = "over_field_name must be set when the ''{0}'' function is used"; public static final String JOB_CONFIG_ID_ALREADY_TAKEN = "The job cannot be created with the Id ''{0}''. The Id is already used."; public static final String JOB_CONFIG_ID_TOO_LONG = "The job id cannot contain more than {0,number,integer} characters."; - public static final String JOB_CONFIG_INFLUENCER_CANNOT_BE_EMPTY = "Influencer names cannot be empty strings"; public static final String JOB_CONFIG_INVALID_CREATE_SETTINGS = "The job is configured with fields [{0}] that are illegal to set at job creation"; public static final String JOB_CONFIG_INVALID_FIELDNAME_CHARS = - "Invalid field name ''{0}''. Field names cannot contain any of these characters: {1}"; + "Invalid field name ''{0}''. Field names including over, by and partition fields cannot contain any of these characters: {1}"; public static final String JOB_CONFIG_INVALID_FIELDNAME = "Invalid field name ''{0}''. Field names including over, by and partition fields cannot be ''{1}''"; public static final String JOB_CONFIG_INVALID_TIMEFORMAT = "Invalid Time format string ''{0}''"; diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfigTests.java b/plugin/src/test/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfigTests.java index 503749c3ce1..5ebdc4f86ce 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfigTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ml/job/config/AnalysisConfigTests.java @@ -791,20 +791,6 @@ public class AnalysisConfigTests extends AbstractSerializingTestCase