diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt index aad64f1e3..3c8f60214 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexMonitorAction.kt @@ -537,8 +537,7 @@ class TransportIndexMonitorAction @Inject constructor( if ( request.monitor.isMonitorOfStandardType() && Monitor.MonitorType.valueOf(request.monitor.monitorType.uppercase(Locale.ROOT)) == - Monitor.MonitorType.DOC_LEVEL_MONITOR && - request.monitor.deleteQueryIndexInEveryRun == false + Monitor.MonitorType.DOC_LEVEL_MONITOR ) { indexDocLevelMonitorQueries(request.monitor, indexResponse.id, metadata, request.refreshPolicy) } @@ -711,14 +710,12 @@ class TransportIndexMonitorAction @Inject constructor( .execute(it) } } - if (currentMonitor.deleteQueryIndexInEveryRun == false) { - indexDocLevelMonitorQueries( - request.monitor, - currentMonitor.id, - updatedMetadata, - request.refreshPolicy - ) - } + indexDocLevelMonitorQueries( + request.monitor, + currentMonitor.id, + updatedMetadata, + request.refreshPolicy + ) MonitorMetadataService.upsertMetadata(updatedMetadata, updating = true) } actionListener.onResponse(