File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
src/Elastic.Clients.Elasticsearch/Api Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 22// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33// See the LICENSE file in the project root for more information.
44
5+ using System ;
6+
57namespace Elastic . Clients . Elasticsearch . Core . Bulk ;
68
79public abstract partial class ResponseItem
@@ -15,12 +17,19 @@ public bool IsValid
1517 if ( Error is not null )
1618 return false ;
1719
18- return Operation . ToLowerInvariant ( ) switch
20+ var operation = Operation ;
21+
22+ if ( operation . Equals ( "delete" , StringComparison . OrdinalIgnoreCase ) )
23+ return Status is 200 or 404 ;
24+
25+ if ( operation . Equals ( "create" , StringComparison . OrdinalIgnoreCase ) ||
26+ operation . Equals ( "update" , StringComparison . OrdinalIgnoreCase ) ||
27+ operation . Equals ( "index" , StringComparison . OrdinalIgnoreCase ) )
1928 {
20- "delete" => Status == 200 || Status == 404 ,
21- "update" or "index" or "create" => Status == 200 || Status == 201 ,
22- _ => false ,
23- } ;
29+ return Status is 200 or 201 ;
30+ }
31+
32+ return false ;
2433 }
2534 }
2635}
You can’t perform that action at this time.
0 commit comments