assertThat(docIdsToLoad.values().iterator().next().size(), equalTo(1));
FetchSearchResult fetchResult = searchService.executeFetchPhase(new FetchSearchRequest(queryResult.id(), docIdsToLoad.values().iterator().next()));
assertThat(fetchResult.hits().hits()[0].sourceAsString(), equalTo(source("1", "test1", 1)));
assertThat(fetchResult.hits().hits()[0].id(), equalTo("1"));
assertThat(fetchResult.hits().hits()[0].type(), equalTo("type1"));
}
@Test public void testQueryThenFetchIterateWithFrom() throws Exception {
QuerySearchResult queryResult = searchService.executeQueryPhase(searchRequest(searchSource().query(matchAllQuery()).from(0).size(2), SearchType.QUERY_THEN_FETCH));
assertThat(queryResult.topDocs().totalHits, equalTo(5));