@@ -82,6 +82,7 @@ public class DeleteModelTransportAction extends HandledTransportAction<ActionReq
82
82
static final String BULK_FAILURE_MSG = "Bulk failure while deleting model of " ;
83
83
static final String SEARCH_FAILURE_MSG = "Search failure while deleting model of " ;
84
84
static final String OS_STATUS_EXCEPTION_MESSAGE = "Failed to delete all model chunks" ;
85
+ static final String PIPELINE_TARGET_MODEL_KEY = "model_id" ;
85
86
Client client ;
86
87
NamedXContentRegistry xContentRegistry ;
87
88
ClusterService clusterService ;
@@ -497,13 +498,15 @@ private <T> Boolean isPipelineContainsModel(
497
498
return false ;
498
499
}
499
500
500
- private Boolean searchThroughConfig (Object searchCandidate , String candidateId , String prefixKey ) {
501
+ private Boolean searchThroughConfig (Object searchCandidate , String candidateId , String targetModelKey ) {
501
502
Boolean flag = false ;
502
- if (searchCandidate instanceof String && Objects .equals (prefixKey , "model_id" ) && Objects .equals (candidateId , searchCandidate )) {
503
+ if (searchCandidate instanceof String
504
+ && Objects .equals (targetModelKey , PIPELINE_TARGET_MODEL_KEY )
505
+ && Objects .equals (candidateId , searchCandidate )) {
503
506
return true ;
504
507
} else if (searchCandidate instanceof List <?>) {
505
508
for (Object v : (List <?>) searchCandidate ) {
506
- flag = flag || searchThroughConfig (v , candidateId , prefixKey );
509
+ flag = flag || searchThroughConfig (v , candidateId , targetModelKey );
507
510
}
508
511
} else if (searchCandidate instanceof Map <?, ?>) {
509
512
for (Map .Entry <String , Object > entry : ((Map <String , Object >) searchCandidate ).entrySet ()) {
0 commit comments