public FlatSearchResponse searchFlat( FlatSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { return searcher.searchFlatPaged( request, indexingContexts.values() ); } else { return searcher.forceSearchFlatPaged( request, request.getContexts() ); } }
public IteratorSearchResponse searchIterator( IteratorSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { return searcher.searchIteratorPaged( request, indexingContexts.values() ); } else { return searcher.forceSearchIteratorPaged( request, request.getContexts() ); } }
/** * @deprecated use {@link #searchFlat(FlatSearchRequest)} instead */ @Deprecated public Collection<ArtifactInfo> searchFlat( Comparator<ArtifactInfo> artifactInfoComparator, Query query, IndexingContext context ) throws IOException { return searcher.searchFlat( artifactInfoComparator, context, query ); }
public GroupedSearchResponse searchGrouped( GroupedSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { // search all return searcher.searchGrouped( request, indexingContexts.values() ); } else { // search targeted return searcher.forceSearchGrouped( request, request.getContexts() ); } }
/** * @deprecated use {@link #searchGrouped(GroupedSearchRequest) */ @Deprecated public Map<String, ArtifactInfoGroup> searchGrouped( Grouping grouping, Comparator<String> groupKeyComparator, Query query, IndexingContext context ) throws IOException { return searcher.searchGrouped( new GroupedSearchRequest( query, grouping, groupKeyComparator ), Arrays.asList( new IndexingContext[] { context } ) ).getResults(); }
public ArtifactInfo identify( Query query, Collection<IndexingContext> contexts ) throws IOException { IteratorSearchResponse result = searcher.searchIteratorPaged( new IteratorSearchRequest( query ), contexts ); // TODO: this implementation is flakey: case a) 0 hits is okay, b) 1 hit is okay, c1) >1 hits and all same GAVs // -- okay but which source repo will be used? c2) >1 hits, and different GAVs --- huh? if ( result.getTotalHits() > 0 ) { return result.getResults().next(); } else { return null; } }
/** * @deprecated use {@link #searchGrouped(GroupedSearchRequest) */ @Deprecated public Map<String, ArtifactInfoGroup> searchGrouped( Grouping grouping, Comparator<String> groupKeyComparator, Query query ) throws IOException { return searcher.searchGrouped( new GroupedSearchRequest( query, grouping, groupKeyComparator ), indexingContexts.values() ).getResults(); }
/** * @deprecated use {@link #searchFlat(FlatSearchRequest)} instead */ @Deprecated public Collection<ArtifactInfo> searchFlat( Comparator<ArtifactInfo> artifactInfoComparator, Query query ) throws IOException { return searcher.searchFlat( artifactInfoComparator, indexingContexts.values(), query ); }