diff --git a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt index 62d7e83b9..268087f1e 100644 --- a/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt +++ b/alerting/src/main/kotlin/org/opensearch/alerting/transport/TransportGetFindingsAction.kt @@ -134,7 +134,7 @@ class TransportGetFindingsSearchAction @Inject constructor( ) ) } - searchSourceBuilder.query(queryBuilder) + searchSourceBuilder.query(queryBuilder).trackTotalHits(true) client.threadPool().threadContext.stashContext().use { scope.launch { diff --git a/release-notes/opensearch-alerting.release-notes-2.13.0.0.md b/release-notes/opensearch-alerting.release-notes-2.13.0.0.md index 7cd3749d6..ab82a4742 100644 --- a/release-notes/opensearch-alerting.release-notes-2.13.0.0.md +++ b/release-notes/opensearch-alerting.release-notes-2.13.0.0.md @@ -11,7 +11,7 @@ Compatible with OpenSearch 2.13.0 * optimize to fetch only fields relevant to doc level queries in doc level monitor instead of entire _source for each doc #[1441](https://github.com/opensearch-project/alerting/pull/1441) * Add jvm aware setting and max num docs settings for batching docs for percolate queries #[1435](https://github.com/opensearch-project/alerting/pull/1435) * fix for MapperException[the [enabled] parameter can't be updated for the object mapping [metadata.source_to_query_index_mapping] (#[1432](https://github.com/opensearch-project/alerting/pull/1432)) (#[1434](https://github.com/opensearch-project/alerting/pull/1434)) - +* adding tracking_total_hits in search query for findings (#[1487](https://github.com/opensearch-project/alerting/pull/1487)) ### Enhancements * Enhance per bucket, and per document monitor notification message ctx. (#[1450](https://github.com/opensearch-project/alerting/pull/1450)) (#[1477](https://github.com/opensearch-project/alerting/pull/1477)) @@ -20,4 +20,4 @@ Compatible with OpenSearch 2.13.0 * add distributed locking to jobs in alerting (#[1403](https://github.com/opensearch-project/alerting/pull/1403)) (#[1458](https://github.com/opensearch-project/alerting/pull/1458)) ### Documentation -* Added 2.13 release notes (#[1483](https://github.com/opensearch-project/alerting/pull/1483)) \ No newline at end of file +* Added 2.13 release notes (#[1483](https://github.com/opensearch-project/alerting/pull/1483))