[TEST] stabilize SimpleSearchIT.testQueryNumericFieldWithRegex

Provide mappings explicitly instead of relying on dynamic mapping, also add missing ensureGreen.

Closes #15105
This commit is contained in:
javanna 2015-12-01 12:12:56 +01:00 committed by Luca Cavanna
parent 059a675aa5
commit d17d629422
1 changed files with 3 additions and 3 deletions

View File

@ -333,9 +333,9 @@ public class SimpleSearchIT extends ESIntegTestCase {
} }
public void testQueryNumericFieldWithRegex() throws Exception { public void testQueryNumericFieldWithRegex() throws Exception {
createIndex("idx"); assertAcked(prepareCreate("idx").addMapping("type", "num", "type=integer"));
indexRandom(true, client().prepareIndex("idx", "type").setSource("num", 34)); ensureGreen("idx");
try { try {
client().prepareSearch("idx").setQuery(QueryBuilders.regexpQuery("num", "34")).get(); client().prepareSearch("idx").setQuery(QueryBuilders.regexpQuery("num", "34")).get();
fail("SearchPhaseExecutionException should have been thrown"); fail("SearchPhaseExecutionException should have been thrown");