@Deprecated public Set<ArtifactInfo> searchFlat( Comparator<ArtifactInfo> artifactInfoComparator, Collection<IndexingContext> indexingContexts, Query query ) throws IOException { return searchFlatPaged( new FlatSearchRequest( query, artifactInfoComparator ), indexingContexts ).getResults(); }
@Deprecated public Set<ArtifactInfo> searchFlat( Comparator<ArtifactInfo> artifactInfoComparator, IndexingContext indexingContext, Query query ) throws IOException { return searchFlatPaged( new FlatSearchRequest( query, artifactInfoComparator, indexingContext ) ).getResults(); }
private void listWar(TreeMap<VersionNumber, HudsonWar> r, String groupId, VersionNumber cap) throws IOException { BooleanQuery q = new BooleanQuery(); q.add(indexer.constructQuery(ArtifactInfo.GROUP_ID,groupId), Occur.MUST); q.add(indexer.constructQuery(ArtifactInfo.PACKAGING,"war"), Occur.MUST); FlatSearchRequest request = new FlatSearchRequest(q); FlatSearchResponse response = indexer.searchFlat(request); for (ArtifactInfo a : response.getResults()) { if (a.version.contains("SNAPSHOT")) continue; // ignore snapshots if (a.version.contains("JENKINS")) continue; // non-public releases for addressing specific bug fixes if (!a.artifactId.equals("jenkins-war") && !a.artifactId.equals("hudson-war")) continue; // somehow using this as a query results in 0 hits. if (a.classifier!=null) continue; // just pick up the main war if (IGNORE.containsKey(a.artifactId + "-" + a.version)) { System.out.println("=> Ignoring " + a.artifactId + ", version " + a.version + " because this version is blacklisted"); continue; } if (cap!=null && new VersionNumber(a.version).compareTo(cap)>0) continue; VersionNumber v = new VersionNumber(a.version); r.put(v, createHudsonWarArtifact(a)); } }
q.add(indexer.constructQuery(ArtifactInfo.PACKAGING,"jpi"), Occur.SHOULD); FlatSearchRequest request = new FlatSearchRequest(q); FlatSearchResponse response = indexer.searchFlat(request);
req = new FlatSearchRequest( q, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR ); req = new FlatSearchRequest( q, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR );
req = new FlatSearchRequest( bq, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR ); req = new FlatSearchRequest( bq, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR );
req = new FlatSearchRequest( bq, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR ); req = new FlatSearchRequest( bq, ArtifactInfo.REPOSITORY_VERSION_COMPARATOR );
public ArchetypeCatalog getArchetypeCatalog( Properties properties ) throws ArchetypeDataSourceException { ArchetypeCatalog catalog = new ArchetypeCatalog(); try { Map<String, String> repositories = getRepositoryMap(); Query pq = indexer.constructQuery( ArtifactInfo.PACKAGING, "^maven-archetype$" ); FlatSearchRequest searchRequest = new FlatSearchRequest( pq ); // cstamas: old code was this // FlatSearchRequest searchRequest = new FlatSearchRequest( // // new TermQuery( new Term( ArtifactInfo.PACKAGING, "maven-archetype" ) ) ); FlatSearchResponse searchResponse = indexer.searchFlat( searchRequest ); for ( ArtifactInfo info : searchResponse.getResults() ) { Archetype archetype = new Archetype(); archetype.setGroupId( info.groupId ); archetype.setArtifactId( info.artifactId ); archetype.setVersion( info.version ); archetype.setDescription( info.description ); archetype.setRepository( repositories.get( info.repository ) ); catalog.addArchetype( archetype ); } } catch ( Exception ex ) { getLogger().error( "Unable to retrieve archetypes", ex ); } return catalog; }