Package org.elasticsearch.search.fetch

Examples of org.elasticsearch.search.fetch.QueryFetchSearchResult.shardTarget()


        AggregatedDfs dfs = searchPhaseController.aggregateDfs(dfsResults);
        Map<SearchShardTarget, QueryFetchSearchResult> queryFetchResults = newHashMap();
        for (DfsSearchResult dfsResult : dfsResults) {
            QueryFetchSearchResult queryFetchResult = nodeToSearchService.get(dfsResult.shardTarget().nodeId()).executeFetchPhase(new QuerySearchRequest(dfsResult.id(), dfs));
            queryFetchResults.put(queryFetchResult.shardTarget(), queryFetchResult);
        }


        ShardDoc[] sortedShardList = searchPhaseController.sortDocs(queryFetchResults.values());
        SearchHits hits = searchPhaseController.merge(sortedShardList, queryFetchResults, queryFetchResults).hits();
View Full Code Here


        for (ShardIterator shardIt : clusterService.operationRouting().searchShards(clusterService.state(), new String[]{"test"}, new String[]{"test"}, null, null, null)) {
            for (ShardRouting shardRouting : shardIt.asUnordered()) {
                InternalSearchRequest searchRequest = searchRequest(shardRouting, sourceBuilder, SearchType.QUERY_AND_FETCH)
                        .scroll(new Scroll(new TimeValue(10, TimeUnit.MINUTES)));
                QueryFetchSearchResult queryFetchResult = nodeToSearchService.get(shardRouting.currentNodeId()).executeFetchPhase(searchRequest);
                queryFetchResults.put(queryFetchResult.shardTarget(), queryFetchResult);
            }
        }


        ShardDoc[] sortedShardList = searchPhaseController.sortDocs(queryFetchResults.values());
View Full Code Here

        // scrolling with query+fetch is not perfect when it comes to dist sorting
        Map<SearchShardTarget, QueryFetchSearchResult> scrollQueryFetchResults = newHashMap();
        for (QueryFetchSearchResult searchResult : queryFetchResults.values()) {
            QueryFetchSearchResult queryFetchResult = nodeToSearchService.get(searchResult.shardTarget().nodeId()).executeFetchPhase(new InternalScrollSearchRequest(searchResult.id()).scroll(new Scroll(timeValueMinutes(10)))).result();
            scrollQueryFetchResults.put(queryFetchResult.shardTarget(), queryFetchResult);
        }
        queryFetchResults = scrollQueryFetchResults;

        sortedShardList = searchPhaseController.sortDocs(queryFetchResults.values());
        hits = searchPhaseController.merge(sortedShardList, queryFetchResults, queryFetchResults).hits();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.