From 185521be4bcbb68ec3496fc6126fd0b50d085ceb Mon Sep 17 00:00:00 2001 From: Britta Weber Date: Fri, 12 Dec 2014 17:34:07 +0100 Subject: [PATCH] [TEST] wait for yellow before searching --- .../elasticsearch/search/functionscore/FunctionScoreTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/org/elasticsearch/search/functionscore/FunctionScoreTests.java b/src/test/java/org/elasticsearch/search/functionscore/FunctionScoreTests.java index 409a1548f25..9f3eed9b4dc 100644 --- a/src/test/java/org/elasticsearch/search/functionscore/FunctionScoreTests.java +++ b/src/test/java/org/elasticsearch/search/functionscore/FunctionScoreTests.java @@ -442,6 +442,7 @@ public class FunctionScoreTests extends ElasticsearchIntegrationTest { public void testMinScoreFunctionScoreBasic() throws IOException { index(INDEX, TYPE, jsonBuilder().startObject().field("num", 2).endObject()); refresh(); + ensureYellow(); float score = randomFloat(); float minScore = randomFloat(); SearchResponse searchResponse = client().search( @@ -476,6 +477,7 @@ public class FunctionScoreTests extends ElasticsearchIntegrationTest { docs.add(client().prepareIndex(INDEX, TYPE, Integer.toString(i)).setSource("num", i + scoreOffset)); } indexRandom(true, docs); + ensureYellow(); String script = "return (doc['num'].value)"; int numMatchingDocs = numDocs + scoreOffset - minScore; if (numMatchingDocs < 0) {