testIndexCausesIndexCreation should not use the `_primary` preference
It's dangerous (we moved primaries around without being able to fall back to the replicas) and it is deprecated (removed in 7.0)
@@ -75,8 +75,8 @@ public class SearchWhileCreatingIndexIT extends ESIntegTestCase {
// we want to make sure that while recovery happens, and a replica gets recovered, its properly refreshed
ClusterHealthStatus status = client().admin().cluster().prepareHealth("test").get().getStatus();;
while (status != ClusterHealthStatus.GREEN) {
- // first, verify that search on the primary search works
- SearchResponse searchResponse = client().prepareSearch("test").setPreference("_primary").setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
+ // first, verify that search normal search works
+ SearchResponse searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
assertHitCount(searchResponse, 1);
Client client = client();
searchResponse = client.prepareSearch("test").setPreference(preference + Integer.toString(counter++)).setQuery(QueryBuilders.termQuery("field", "test")).execute().actionGet();
