public Collection<ArtifactInfo> identify( Query query, Collection<IndexingContext> contexts ) throws IOException { final IteratorSearchResponse result = searcher.searchIteratorPaged( new IteratorSearchRequest( query ), contexts ); try { final ArrayList<ArtifactInfo> ais = new ArrayList<ArtifactInfo>( result.getTotalHitsCount() ); for ( ArtifactInfo ai : result ) { ais.add( ai ); } return ais; } finally { result.close(); } }
public Collection<ArtifactInfo> identify( Query query, Collection<IndexingContext> contexts ) throws IOException { final IteratorSearchResponse result = searcher.searchIteratorPaged( new IteratorSearchRequest( query ), contexts ); try { final ArrayList<ArtifactInfo> ais = new ArrayList<ArtifactInfo>( result.getTotalHitsCount() ); for ( ArtifactInfo ai : result ) { ais.add( ai ); } return ais; } finally { result.close(); } }
public Collection<ArtifactInfo> identify( Query query, Collection<IndexingContext> contexts ) throws IOException { final IteratorSearchResponse result = searcher.searchIteratorPaged( new IteratorSearchRequest( query ), contexts ); try { final ArrayList<ArtifactInfo> ais = new ArrayList<ArtifactInfo>( result.getTotalHitsCount() ); for ( ArtifactInfo ai : result ) { ais.add( ai ); } return ais; } finally { result.close(); } }
@Override public void run(RepositoryInfo repo, IndexingContext context) throws IOException { IteratorSearchResponse response = repeatedPagedSearch(q, Collections.singletonList(context), MAX_RESULT_COUNT); if (response != null) { try { for (ArtifactInfo ai : response.iterator()) { infos.add(convertToNBVersionInfo(ai)); } } finally { Accessor.ACCESSOR.addReturnedResults(result, response.getTotalProcessedArtifactInfoCount()); Accessor.ACCESSOR.addTotalResults(result, response.getTotalHitsCount()); response.close(); } } } }, skipAction, skipUnIndexed);
searchResponse.close();
artifacts.close();
artifacts.close();
if (searchResult != null) { try { searchResult.close();
public ArchetypeCatalog listArcherypesAsCatalog(final MacRequest request, final IndexingContext ctx) throws IOException { final IteratorSearchResponse infos = listArchetypes(request, ctx); try { final ArchetypeCatalog catalog = new ArchetypeCatalog(); Archetype archetype = null; // fill it in for (ArtifactInfo info : infos) { archetype = new Archetype(); archetype.setGroupId(info.groupId); archetype.setArtifactId(info.artifactId); archetype.setVersion(info.version); archetype.setDescription(info.description); if (StringUtils.isNotEmpty(request.getRepositoryUrl())) { archetype.setRepository(request.getRepositoryUrl()); } catalog.addArchetype(archetype); } return catalog; } finally { if (infos != null) { infos.close(); } } }
searchResponse.close();