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)
9898 if ( value . IsNullOrEmpty ( ) )
9999 throw new ArgumentException ( "cannot be null or empty" , nameof ( value ) ) ;
100100
101+ if ( value . Equals ( "false" , StringComparison . OrdinalIgnoreCase ) )
102+ return Disabled ;
103+
101104 var expandReplicaParts = value . Split ( '-' ) ;
102105 if ( expandReplicaParts . Length != 2 )
103106 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()
7777 autoExpandReplicas . ToString ( ) . Should ( ) . Be ( "0-all" ) ;
7878 }
7979
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+
8091 [ U ]
8192 public void Disabled ( )
8293 {
You can’t perform that action at this time.
0 commit comments