103
103
import static org .hamcrest .Matchers .empty ;
104
104
import static org .hamcrest .Matchers .greaterThan ;
105
105
import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
106
+ import static org .hamcrest .Matchers .lessThanOrEqualTo ;
106
107
import static org .hamcrest .Matchers .not ;
107
108
108
109
/**
@@ -438,7 +439,6 @@ public void testSortByFieldOneClusterHasNoResults() throws Exception {
438
439
assumeMultiClusterSetup ();
439
440
SearchRequest searchRequest = initSearchRequest ();
440
441
// set to a value greater than the number of shards to avoid differences due to the skipping of shards
441
- searchRequest .setPreFilterShardSize (128 );
442
442
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder ();
443
443
boolean onlyRemote = randomBoolean ();
444
444
sourceBuilder .query (new TermQueryBuilder ("_index" , onlyRemote ? REMOTE_INDEX_NAME : INDEX_NAME ));
@@ -461,7 +461,6 @@ public void testSortByFieldOneClusterHasNoResults() throws Exception {
461
461
});
462
462
}
463
463
464
- @ AwaitsFix (bugUrl = "https://github.com/elastic/elasticsearch/issues/79365" )
465
464
public void testFieldCollapsingOneClusterHasNoResults () throws Exception {
466
465
assumeMultiClusterSetup ();
467
466
SearchRequest searchRequest = initSearchRequest ();
@@ -771,6 +770,7 @@ private static void duelSearch(SearchRequest searchRequest, Consumer<SearchRespo
771
770
message .compareMaps (minimizeRoundtripsResponseMap , fanOutResponseMap );
772
771
throw new AssertionError ("Didn't match expected value:\n " + message );
773
772
}
773
+ assertThat (minimizeRoundtripsSearchResponse .getSkippedShards (), lessThanOrEqualTo (fanOutSearchResponse .getSkippedShards ()));
774
774
}
775
775
}
776
776
@@ -835,6 +835,10 @@ private static Map<String, Object> responseToMap(SearchResponse response) throws
835
835
shard .remove ("fetch" );
836
836
}
837
837
}
838
+ Map <String , Object > shards = (Map <String , Object >)responseMap .get ("_shards" );
839
+ if (shards != null ) {
840
+ shards .remove ("skipped" );
841
+ }
838
842
return responseMap ;
839
843
}
840
844
0 commit comments