@@ -178,7 +178,7 @@ protected static void assertVisibleCount(Engine engine, int numDocs, boolean ref
178178 engine .refresh ("test" );
179179 }
180180 try (Engine .Searcher searcher = engine .acquireSearcher ("test" )) {
181- Integer totalHits = searcher .search (new MatchAllDocsQuery (), new TotalHitCountCollectorManager ());
181+ Integer totalHits = searcher .search (new MatchAllDocsQuery (), new TotalHitCountCollectorManager (searcher . getSlices () ));
182182 assertThat (totalHits , equalTo (numDocs ));
183183 }
184184 }
@@ -970,7 +970,7 @@ protected static void assertVisibleCount(InternalEngine engine, int numDocs, boo
970970 engine .refresh ("test" );
971971 }
972972 try (Engine .Searcher searcher = engine .acquireSearcher ("test" )) {
973- Integer totalHits = searcher .search (new MatchAllDocsQuery (), new TotalHitCountCollectorManager ());
973+ Integer totalHits = searcher .search (new MatchAllDocsQuery (), new TotalHitCountCollectorManager (searcher . getSlices () ));
974974 assertThat (totalHits , equalTo (numDocs ));
975975 }
976976 }
@@ -1168,7 +1168,10 @@ public static void assertOpsOnReplica(
11681168 assertVisibleCount (replicaEngine , lastFieldValue == null ? 0 : 1 );
11691169 if (lastFieldValue != null ) {
11701170 try (Engine .Searcher searcher = replicaEngine .acquireSearcher ("test" )) {
1171- Integer totalHits = searcher .search (new TermQuery (new Term ("value" , lastFieldValue )), new TotalHitCountCollectorManager ());
1171+ Integer totalHits = searcher .search (
1172+ new TermQuery (new Term ("value" , lastFieldValue )),
1173+ new TotalHitCountCollectorManager (searcher .getSlices ())
1174+ );
11721175 assertThat (totalHits , equalTo (1 ));
11731176 }
11741177 }
0 commit comments