From 1fd5a48409635722860f6d923406d745bfb2dd32 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Thu, 8 Dec 2011 16:28:57 +0200 Subject: [PATCH] wait for yellow status before searching --- .../test/integration/search/query/SimpleQueryTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java b/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java index 8367edaeb88..b77a65b94be 100644 --- a/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java +++ b/src/test/java/org/elasticsearch/test/integration/search/query/SimpleQueryTests.java @@ -323,6 +323,9 @@ public class SimpleQueryTests extends AbstractNodesTests { client.admin().indices().prepareDelete().execute().actionGet(); client.prepareIndex("test", "type1", "1").setSource("field1", "value1").execute().actionGet(); + + client.admin().cluster().prepareHealth().setWaitForYellowStatus().execute().actionGet(); + client.admin().indices().prepareRefresh().execute().actionGet(); SearchResponse searchResponse = client.prepareSearch("test").setQuery(constantScoreQuery(termsFilter("field1", "value1").cacheKey("test1"))).execute().actionGet();