Set<String> expectedIds = Sets.newHashSet("1", "2", "3", "4", "5");
assertThat(idsLoaded, equalTo(expectedIds));
}
@Test public void testDfsQueryThenFetch() throws Exception {
DfsSearchResult dfsResult = searchService.executeDfsPhase(searchRequest(searchSource().query(termQuery("name", "test1")), SearchType.DFS_QUERY_THEN_FETCH));
AggregatedDfs dfs = searchPhaseController.aggregateDfs(newArrayList(dfsResult));
QuerySearchResult queryResult = searchService.executeQueryPhase(new QuerySearchRequest(dfsResult.id(), dfs));
assertThat(queryResult.topDocs().totalHits, equalTo(1));
ShardDoc[] sortedShardList = searchPhaseController.sortDocs(newArrayList(queryResult));
Map<SearchShardTarget, ExtTIntArrayList> docIdsToLoad = searchPhaseController.docIdsToLoad(sortedShardList);
assertThat(docIdsToLoad.size(), equalTo(1));