From 4eff25f08f7372318ee79cf031547c73e33003ae Mon Sep 17 00:00:00 2001 From: Tom Richards Date: Mon, 6 Nov 2023 14:25:49 +0000 Subject: [PATCH] fix reporting of `searchResponseCount` as it was always 10k --- .../gu/mediaservice/lib/elasticsearch/ElasticSearchClient.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common-lib/src/main/scala/com/gu/mediaservice/lib/elasticsearch/ElasticSearchClient.scala b/common-lib/src/main/scala/com/gu/mediaservice/lib/elasticsearch/ElasticSearchClient.scala index ee7734d80e..50e0500fe5 100644 --- a/common-lib/src/main/scala/com/gu/mediaservice/lib/elasticsearch/ElasticSearchClient.scala +++ b/common-lib/src/main/scala/com/gu/mediaservice/lib/elasticsearch/ElasticSearchClient.scala @@ -82,7 +82,7 @@ trait ElasticSearchClient extends ElasticSearchExecutions with GridLogging { def countImages(indexName: String = imagesCurrentAlias): Future[ElasticSearchImageCounts] = { implicit val logMarker = MarkerMap() val queryCatCount = catCount(indexName) // document count only of index including live documents, not deleted documents which have not yet been removed by the merge process - val queryImageSearch = search(indexName) limit 0 // hits that match the query defined in the request + val queryImageSearch = search(indexName) trackTotalHits true limit 0 // hits that match the query defined in the request val queryStats = indexStats(indexName) // total accumulated values of an index for both primary and replica shards val indexForAlias = getIndexForAlias(indexName)