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)