diff --git a/src/Nest/XPack/MachineLearning/Job/Config/ModelPlotConfig.cs b/src/Nest/XPack/MachineLearning/Job/Config/ModelPlotConfig.cs index edda7aacf80..f3c3855e568 100644 --- a/src/Nest/XPack/MachineLearning/Job/Config/ModelPlotConfig.cs +++ b/src/Nest/XPack/MachineLearning/Job/Config/ModelPlotConfig.cs @@ -23,6 +23,15 @@ public interface IModelPlotConfig : IModelPlotConfigEnabled /// [DataMember(Name ="terms")] Fields Terms { get; set; } + + /// + /// If true, enables calculation and storage of the model change annotations + /// for each entity that is being analyzed. By default, this is not enabled. + /// + /// Valid in Elasticsearch 7.9.0+ + /// + [DataMember(Name = "annotations_enabled")] + bool? AnnotationsEnabled { get; set; } } /// @@ -33,6 +42,9 @@ public class ModelPlotConfig : IModelPlotConfig /// public Fields Terms { get; set; } + + /// + public bool? AnnotationsEnabled { get; set; } } /// @@ -40,16 +52,21 @@ public class ModelPlotConfigDescriptor : DescriptorBase + /// public ModelPlotConfigDescriptor Enabled(bool? enabled = true) => Assign(enabled, (a, v) => a.Enabled = v); - /// + /// public ModelPlotConfigDescriptor Terms(Func, IPromise> fields) => Assign(fields, (a, v) => a.Terms = v?.Invoke(new FieldsDescriptor())?.Value); - /// + /// public ModelPlotConfigDescriptor Terms(Fields fields) => Assign(fields, (a, v) => a.Terms = v); + + /// + public ModelPlotConfigDescriptor AnnotationsEnabled(bool? enabled = true) => + Assign(enabled, (a, v) => a.AnnotationsEnabled = v); } ///