diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt index e7d3a08cb..c065fcc57 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportIndexWorkflowAction.kt @@ -748,7 +748,7 @@ class TransportIndexWorkflowAction @Inject constructor( val compositeInput = request.workflow.inputs[0] as CompositeInput val monitorIds = compositeInput.sequence.delegates.stream().map { it.monitorId }.collect(Collectors.toList()) val query = QueryBuilders.boolQuery().filter(QueryBuilders.termsQuery("_id", monitorIds)) - val searchSource = SearchSourceBuilder().query(query) + val searchSource = SearchSourceBuilder().query(query).size(monitorIds.size) val searchRequest = SearchRequest(SCHEDULED_JOBS_INDEX).source(searchSource) if (user != null && !isAdmin(user) && filterByEnabled) {