File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
src/Nest/XPack/MachineLearning/MachineLearningInfo
tests/Tests/XPack/MachineLearning/MachineLearningInfo Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 1- using System . Runtime . Serialization ;
1+ using System . Collections . Generic ;
2+ using System . Runtime . Serialization ;
23
34namespace Nest
45{
@@ -33,6 +34,18 @@ public class AnomalyDetectors
3334
3435 [ DataMember ( Name = "model_snapshot_retention_days" ) ]
3536 public int ModelSnapshotRetentionDays { get ; internal set ; }
37+
38+ [ DataMember ( Name = "categorization_analyzer" ) ]
39+ public CategorizationAnalyzer CategorizationAnalyzer { get ; internal set ; }
40+ }
41+
42+ public class CategorizationAnalyzer
43+ {
44+ [ DataMember ( Name = "tokenizer" ) ]
45+ public string Tokenizer { get ; internal set ; }
46+
47+ [ DataMember ( Name = "filter" ) ]
48+ public IReadOnlyCollection < ITokenFilter > Filter { get ; internal set ; }
3649 }
3750
3851 public class Datafeeds
Original file line number Diff line number Diff line change @@ -34,11 +34,20 @@ protected override void ExpectResponse(MachineLearningInfoResponse response)
3434 {
3535 response . ShouldBeValid ( ) ;
3636
37- response . Defaults . AnomalyDetectors . ModelMemoryLimit . Should ( ) . Be ( "1gb" ) ;
38- response . Defaults . AnomalyDetectors . CategorizationExamplesLimit . Should ( ) . Be ( 4 ) ;
39- response . Defaults . AnomalyDetectors . ModelSnapshotRetentionDays . Should ( ) . Be ( 1 ) ;
37+ var anomalyDetectors = response . Defaults . AnomalyDetectors ;
38+ anomalyDetectors . ModelMemoryLimit . Should ( ) . Be ( "1gb" ) ;
39+ anomalyDetectors . CategorizationExamplesLimit . Should ( ) . Be ( 4 ) ;
40+ anomalyDetectors . ModelSnapshotRetentionDays . Should ( ) . Be ( 1 ) ;
4041
4142 response . Defaults . Datafeeds . ScrollSize . Should ( ) . Be ( 1000 ) ;
43+
44+ if ( Cluster . ClusterConfiguration . Version >= "7.6.0" )
45+ {
46+ var analyzer = anomalyDetectors . CategorizationAnalyzer ;
47+ analyzer . Should ( ) . NotBeNull ( ) ;
48+ analyzer . Tokenizer . Should ( ) . Be ( "ml_classic" ) ;
49+ analyzer . Filter . Should ( ) . NotBeNullOrEmpty ( ) ;
50+ }
4251 }
4352 }
4453}
You can’t perform that action at this time.
0 commit comments