From 9c831ba0899eecd74f721caad4ef24b876733e47 Mon Sep 17 00:00:00 2001 From: xinyual Date: Thu, 21 Nov 2024 15:55:20 +0800 Subject: [PATCH] use correct key Signed-off-by: xinyual --- .../ml/action/models/DeleteModelTransportAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java b/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java index f3e5971ebc..5bf2e968d2 100644 --- a/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java +++ b/plugin/src/main/java/org/opensearch/ml/action/models/DeleteModelTransportAction.java @@ -61,6 +61,7 @@ import org.opensearch.index.reindex.DeleteByQueryAction; import org.opensearch.index.reindex.DeleteByQueryRequest; import org.opensearch.ml.common.MLModel; +import org.opensearch.ml.common.agent.MLAgent; import org.opensearch.ml.common.model.MLModelState; import org.opensearch.ml.common.transport.model.MLModelDeleteAction; import org.opensearch.ml.common.transport.model.MLModelDeleteRequest; @@ -534,7 +535,7 @@ private String formatAgentErrorMessage(SearchHit[] hits) { boolean isHidden = false; for (SearchHit hit : hits) { Map sourceAsMap = hit.getSourceAsMap(); - isHidden = isHidden || Boolean.parseBoolean((String) sourceAsMap.getOrDefault(IS_HIDDEN_FIELD, false)); + isHidden = isHidden || Boolean.parseBoolean((String) sourceAsMap.getOrDefault(MLAgent.IS_HIDDEN_FIELD, false)); } if (isHidden) { return String