[ML] Do not serialize rules when empty (elastic/x-pack-elasticsearch#4203)
Original commit: elastic/x-pack-elasticsearch@18d731cb35
This commit is contained in:
parent
f6d318a782
commit
c4ff5ad3ed
|
@ -292,7 +292,9 @@ public class Detector implements ToXContentObject, Writeable {
|
|||
if (excludeFrequent != null) {
|
||||
builder.field(EXCLUDE_FREQUENT_FIELD.getPreferredName(), excludeFrequent);
|
||||
}
|
||||
if (rules.isEmpty() == false) {
|
||||
builder.field(RULES_FIELD.getPreferredName(), rules);
|
||||
}
|
||||
// negative means "unknown", which should only happen for a 5.4 job
|
||||
if (detectorIndex >= 0
|
||||
// no point writing this to cluster state, as the indexes will get reassigned on reload anyway
|
||||
|
|
Loading…
Reference in New Issue