From 22efba5281d80fb06142094c77dbf9b6c81ffffb Mon Sep 17 00:00:00 2001 From: zane-neo Date: Tue, 16 Jan 2024 17:42:34 +0800 Subject: [PATCH] add refresh Signed-off-by: zane-neo --- .../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 237e423698..31ede95e32 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 @@ -24,6 +24,7 @@ import org.opensearch.action.get.GetResponse; import org.opensearch.action.support.ActionFilters; import org.opensearch.action.support.HandledTransportAction; +import org.opensearch.action.support.WriteRequest; import org.opensearch.client.Client; import org.opensearch.cluster.service.ClusterService; import org.opensearch.common.inject.Inject; @@ -221,7 +222,7 @@ private void returnFailure(BulkByScrollResponse response, String modelId, Action } private void deleteModel(String modelId, ActionListener actionListener) { - DeleteRequest deleteRequest = new DeleteRequest(ML_MODEL_INDEX, modelId); + DeleteRequest deleteRequest = new DeleteRequest(ML_MODEL_INDEX, modelId).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE); client.delete(deleteRequest, new ActionListener() { @Override public void onResponse(DeleteResponse deleteResponse) {