public GroupedSearchResponse searchGrouped( GroupedSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { return new GroupedSearchResponse( request.getQuery(), 0, Collections.<String, ArtifactInfoGroup> emptyMap() ); } else { // search targeted return searcher.forceSearchGrouped( request, request.getContexts() ); } }
protected GroupedSearchResponse searchGrouped( GroupedSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext ) throws IOException { List<IndexingContext> contexts = getParticipatingContexts( indexingContexts, ignoreContext ); final TreeMap<String, ArtifactInfoGroup> result = new TreeMap<String, ArtifactInfoGroup>( request.getGroupKeyComparator() ); return new GroupedSearchResponse( request.getQuery(), searchGrouped( request, result, request.getGrouping(), contexts, request.getQuery() ), result ); }
artifactInfo.setContext( context.getId() ); if ( req.getArtifactInfoFilter() != null ) if ( !req.getArtifactInfoFilter().accepts( context, artifactInfo ) ) if ( req.getArtifactInfoPostprocessor() != null ) req.getArtifactInfoPostprocessor().postprocess( context, artifactInfo );
public GroupedSearchResponse searchGrouped( GroupedSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { request.getContexts().addAll( getIndexingContexts().values() ); } return indexer.searchGrouped( request ); }
public List<ArtifactDTO> searchGrouped(Query query, GAGrouping grouping) throws IOException { List<ArtifactDTO> answer = new ArrayList<ArtifactDTO>(); GroupedSearchResponse response = indexer.searchGrouped(new GroupedSearchRequest(query, grouping, mergedContext)); int index = 0; for (Map.Entry<String, ArtifactInfoGroup> entry : response.getResults().entrySet()) { ArtifactInfo ai = entry.getValue().getArtifactInfos().iterator().next(); ArtifactDTO dto = createArtifactDTO(ai); answer.add(dto); if (++index > SEARCH_LIMIT) { break; } } return answer; }
artifactInfo.setContext( context.getId() ); if ( req.getArtifactInfoFilter() != null ) if ( !req.getArtifactInfoFilter().accepts( context, artifactInfo ) ) if ( req.getArtifactInfoPostprocessor() != null ) req.getArtifactInfoPostprocessor().postprocess( context, artifactInfo );
public GroupedSearchResponse searchGrouped( GroupedSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { request.getContexts().addAll( getIndexingContexts().values() ); } return indexer.searchGrouped( request ); }
public void searchGroupedAndDump( Indexer nexusIndexer, String descr, Query q, Grouping g ) throws IOException { System.out.println( "Searching for " + descr ); GroupedSearchResponse response = nexusIndexer.searchGrouped( new GroupedSearchRequest( q, g, centralContext ) ); for ( Map.Entry<String, ArtifactInfoGroup> entry : response.getResults().entrySet() ) { ArtifactInfo ai = entry.getValue().getArtifactInfos().iterator().next(); System.out.println( "* Entry " + ai ); System.out.println( " Latest version: " + ai.getVersion() ); System.out.println( StringUtils.isBlank( ai.getDescription() ) ? "No description in plugin's POM." : StringUtils.abbreviate( ai.getDescription(), MAX_WIDTH ) ); System.out.println(); } System.out.println( "------" ); System.out.println( "Total record hits: " + response.getTotalHitsCount() ); System.out.println(); } }
protected GroupedSearchResponse searchGrouped( GroupedSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext ) throws IOException { List<IndexingContext> contexts = getParticipatingContexts( indexingContexts, ignoreContext ); final TreeMap<String, ArtifactInfoGroup> result = new TreeMap<String, ArtifactInfoGroup>( request.getGroupKeyComparator() ); return new GroupedSearchResponse( request.getQuery(), searchGrouped( request, result, request.getGrouping(), contexts, request.getQuery() ), result ); }
public GroupedSearchResponse searchGrouped( GroupedSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { return new GroupedSearchResponse( request.getQuery(), 0, Collections.<String, ArtifactInfoGroup>emptyMap() ); } else { // search targeted return searcher.forceSearchGrouped( request, request.getContexts() ); } }
artifactInfo.setContext( context.getId() ); if ( req.getArtifactInfoFilter() != null ) if ( !req.getArtifactInfoFilter().accepts( context, artifactInfo ) ) if ( req.getArtifactInfoPostprocessor() != null ) req.getArtifactInfoPostprocessor().postprocess( context, artifactInfo );
public GroupedSearchResponse searchGrouped( GroupedSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { request.getContexts().addAll( getIndexingContexts().values() ); } return indexer.searchGrouped( request ); }
protected GroupedSearchResponse searchGrouped( GroupedSearchRequest request, Collection<IndexingContext> indexingContexts, boolean ignoreContext ) throws IOException { List<IndexingContext> contexts = getParticipatingContexts( indexingContexts, ignoreContext ); final TreeMap<String, ArtifactInfoGroup> result = new TreeMap<String, ArtifactInfoGroup>( request.getGroupKeyComparator() ); return new GroupedSearchResponse( request.getQuery(), searchGrouped( request, result, request.getGrouping(), contexts, request.getQuery() ), result ); }
public GroupedSearchResponse searchGrouped( GroupedSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { return new GroupedSearchResponse( request.getQuery(), 0, Collections.<String, ArtifactInfoGroup>emptyMap() ); } else { // search targeted return searcher.forceSearchGrouped( request, request.getContexts() ); } }