From 6ed9f50457282c8a7702799a7db612d8c0f5b393 Mon Sep 17 00:00:00 2001 From: Tanguy Leroux Date: Fri, 24 Jun 2016 09:19:59 +0200 Subject: [PATCH] Fix SearchInputIT.testSearchInlineTemplate The search type is overridden from default to query_and_fetch by the search action if the number of shards to request is equal to 1 Original commit: elastic/x-pack-elasticsearch@a9552c697cd76ad67fbc6c315112b3fc82e948b1 --- .../java/org/elasticsearch/messy/tests/SearchInputIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java index 635c40756dd..bb5a50d38d3 100644 --- a/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java +++ b/elasticsearch/qa/messy-test-xpack-with-mustache/src/test/java/org/elasticsearch/messy/tests/SearchInputIT.java @@ -200,7 +200,9 @@ public class SearchInputIT extends ESIntegTestCase { assertNotNull(executedResult.executedRequest()); assertThat(executedResult.status(), is(Input.Result.Status.SUCCESS)); - assertEquals(executedResult.executedRequest().searchType(), request.searchType()); + if (getNumShards("test-search-index").numPrimaries > 1) { + assertEquals(executedResult.executedRequest().searchType(), request.searchType()); + } assertArrayEquals(executedResult.executedRequest().indices(), request.indices()); assertEquals(executedResult.executedRequest().indicesOptions(), request.indicesOptions());