@@ -17,30 +17,10 @@ public interface ICreateIndexRequest : IIndexPath<CreateIndexRequestParameters>
1717
1818 internal static class CreateIndexPathInfo
1919 {
20- private static char [ ] _invalidChars = new [ ] { '\\ ' , '/' , '*' , '?' , '"' , '<' , '>' , '|' , ' ' , ',' , '#' } ;
21- private static string _invalidCharsMessage = string . Join ( ", " , _invalidChars ) ;
22-
2320 public static void Update ( ElasticsearchPathInfo < CreateIndexRequestParameters > pathInfo , ICreateIndexRequest request )
2421 {
2522 pathInfo . HttpMethod = PathInfoHttpMethod . POST ;
2623 }
27-
28- public static void Validate ( ElasticsearchPathInfo < CreateIndexRequestParameters > pathInfo , ICreateIndexRequest request )
29- {
30- var index = pathInfo . Index ;
31- if ( index . StartsWith ( "_" ) )
32- throw new DslException ( "indexname {0} may not start with an underscore" . F ( index ) ) ;
33-
34- if ( Encoding . UTF8 . GetByteCount ( index ) > 255 )
35- throw new DslException ( "indexname {0} exceeds maximum index name length of 255" . F ( index ) ) ;
36-
37- if ( index . Any ( char . IsUpper ) )
38- throw new DslException ( "indexname {0} contains uppercase characters" . F ( index ) ) ;
39-
40- if ( index . Any ( c => _invalidChars . Contains ( c ) ) )
41- throw new DslException ( "indexname {0} contains one of {1} invalid characters" . F ( index , _invalidCharsMessage ) ) ;
42-
43- }
4424 }
4525
4626 public partial class CreateIndexRequest : IndexPathBase < CreateIndexRequestParameters > , ICreateIndexRequest
@@ -53,11 +33,6 @@ protected override void UpdatePathInfo(IConnectionSettingsValues settings, Elast
5333 {
5434 CreateIndexPathInfo . Update ( pathInfo , this ) ;
5535 }
56-
57- protected override void ValidatePathInfo ( ElasticsearchPathInfo < CreateIndexRequestParameters > pathInfo )
58- {
59- CreateIndexPathInfo . Validate ( pathInfo , this ) ;
60- }
6136 }
6237
6338 [ DescriptorFor ( "IndicesCreate" ) ]
@@ -259,11 +234,5 @@ protected override void UpdatePathInfo(IConnectionSettingsValues settings, Elast
259234 {
260235 CreateIndexPathInfo . Update ( pathInfo , this ) ;
261236 }
262-
263- protected override void ValidatePathInfo ( ElasticsearchPathInfo < CreateIndexRequestParameters > pathInfo )
264- {
265- CreateIndexPathInfo . Validate ( pathInfo , this ) ;
266- }
267-
268237 }
269238}
0 commit comments