File tree 2 files changed +26
-4
lines changed
src/Nest/XPack/MachineLearning/MachineLearningInfo
tests/Tests/XPack/MachineLearning/MachineLearningInfo
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 ;
2
3
3
4
namespace Nest
4
5
{
@@ -33,6 +34,18 @@ public class AnomalyDetectors
33
34
34
35
[ DataMember ( Name = "model_snapshot_retention_days" ) ]
35
36
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 ; }
36
49
}
37
50
38
51
public class Datafeeds
Original file line number Diff line number Diff line change @@ -34,11 +34,20 @@ protected override void ExpectResponse(MachineLearningInfoResponse response)
34
34
{
35
35
response . ShouldBeValid ( ) ;
36
36
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 ) ;
40
41
41
42
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
+ }
42
51
}
43
52
}
44
53
}
You can’t perform that action at this time.
0 commit comments