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));