public IteratorSearchResponse searchIterator( IteratorSearchRequest request ) throws IOException { if ( request.getContexts().isEmpty() ) { return searcher.searchIteratorPaged( request, indexingContexts.values() ); } else { return searcher.forceSearchIteratorPaged( request, request.getContexts() ); } }
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; } }