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@a9552c697c
This commit is contained in:
Tanguy Leroux 2016-06-24 09:19:59 +02:00
parent d52418d92e
commit 6ed9f50457
1 changed files with 3 additions and 1 deletions

View File

@ -200,7 +200,9 @@ public class SearchInputIT extends ESIntegTestCase {
assertNotNull(executedResult.executedRequest()); assertNotNull(executedResult.executedRequest());
assertThat(executedResult.status(), is(Input.Result.Status.SUCCESS)); 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()); assertArrayEquals(executedResult.executedRequest().indices(), request.indices());
assertEquals(executedResult.executedRequest().indicesOptions(), request.indicesOptions()); assertEquals(executedResult.executedRequest().indicesOptions(), request.indicesOptions());