File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
src/Nest/IndexModules/IndexSettings/Settings
tests/Tests/CommonOptions/AutoExpandReplicas Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ public static AutoExpandReplicas Create(string value)
98
98
if ( value . IsNullOrEmpty ( ) )
99
99
throw new ArgumentException ( "cannot be null or empty" , nameof ( value ) ) ;
100
100
101
+ if ( value . Equals ( "false" , StringComparison . OrdinalIgnoreCase ) )
102
+ return Disabled ;
103
+
101
104
var expandReplicaParts = value . Split ( '-' ) ;
102
105
if ( expandReplicaParts . Length != 2 )
103
106
throw new ArgumentException ( "must contain a 'from' and 'to' value" , nameof ( value ) ) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,17 @@ public void CreateWithMinAndAll()
77
77
autoExpandReplicas . ToString ( ) . Should ( ) . Be ( "0-all" ) ;
78
78
}
79
79
80
+ [ U ]
81
+ public void CreateWithFalse ( )
82
+ {
83
+ var autoExpandReplicas = Nest . AutoExpandReplicas . Create ( "false" ) ;
84
+ autoExpandReplicas . Should ( ) . NotBeNull ( ) ;
85
+ autoExpandReplicas . Enabled . Should ( ) . BeFalse ( ) ;
86
+ autoExpandReplicas . MinReplicas . Should ( ) . BeNull ( ) ;
87
+ autoExpandReplicas . MaxReplicas . Should ( ) . BeNull ( ) ;
88
+ autoExpandReplicas . ToString ( ) . Should ( ) . Be ( "false" ) ;
89
+ }
90
+
80
91
[ U ]
81
92
public void Disabled ( )
82
93
{
You can’t perform that action at this time.
0 commit comments