public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { Collection<ArtifactInfo> searchResult = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, indexer.constructQuery(ArtifactInfo.NAMES, (className))); infos.addAll(convertToNBVersionInfo(postProcessClasses(searchResult, className))); } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); bq.add(new BooleanClause(new TermQuery(new Term(ArtifactInfo.PACKAGING, "maven-archetype")), BooleanClause.Occur.MUST)); //NOI18N Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); infos.addAll(convertToNBVersionInfo(search)); } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); bq.add(new BooleanClause(new TermQuery(new Term(NB_DEPENDENCY_GROUP, groupId)), BooleanClause.Occur.MUST)); bq.add(new BooleanClause(new TermQuery(new Term(NB_DEPENDENCY_ARTIFACT, artifactId)), BooleanClause.Occur.MUST)); bq.add(new BooleanClause(new TermQuery(new Term(NB_DEPENDENCY_VERSION, version)), BooleanClause.Occur.MUST)); Collection<ArtifactInfo> searchResult = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); infos.addAll(convertToNBVersionInfo(searchResult)); } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); bq.add(new BooleanClause(new TermQuery(new Term(ArtifactInfo.PACKAGING, "maven-plugin")), BooleanClause.Occur.MUST)); bq.add(new BooleanClause(new PrefixQuery(new Term(ArtifactInfo.UINFO, prefix)), BooleanClause.Occur.MUST)); Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); for (ArtifactInfo artifactInfo : search) { artifacts.add(artifactInfo.groupId); } } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); String id = groupId + AbstractIndexCreator.FS + prefix; bq.add(new BooleanClause(new TermQuery(new Term(ArtifactInfo.PACKAGING, "maven-plugin")), BooleanClause.Occur.MUST)); bq.add(new BooleanClause(new PrefixQuery(new Term(ArtifactInfo.UINFO, id)), BooleanClause.Occur.MUST)); Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); for (ArtifactInfo artifactInfo : search) { artifacts.add(artifactInfo.artifactId); } } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); String id = groupId + AbstractIndexCreator.FS + artifactId + AbstractIndexCreator.FS; bq.add(new BooleanClause(new PrefixQuery(new Term(ArtifactInfo.UINFO, id)), BooleanClause.Occur.MUST)); Collection<ArtifactInfo> searchResult = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); infos.addAll(convertToNBVersionInfo(searchResult)); } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); String id = groupId + AbstractIndexCreator.FS + artifactId + AbstractIndexCreator.FS + version + AbstractIndexCreator.FS; bq.add(new BooleanClause(new PrefixQuery(new Term(ArtifactInfo.UINFO, id)), BooleanClause.Occur.MUST)); Collection<ArtifactInfo> searchGrouped = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); infos.addAll(convertToNBVersionInfo(searchGrouped)); } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); String id = groupId + AbstractIndexCreator.FS + prefix; bq.add(new BooleanClause(new PrefixQuery(new Term(ArtifactInfo.UINFO, id)), BooleanClause.Occur.MUST)); Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); for (ArtifactInfo artifactInfo : search) { artifacts.add(artifactInfo.artifactId); } } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { BooleanQuery bq = new BooleanQuery(); checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { String id = groupId + AbstractIndexCreator.FS; bq.add(new BooleanClause(new PrefixQuery(new Term(ArtifactInfo.UINFO, id)), BooleanClause.Occur.MUST)); Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); for (ArtifactInfo artifactInfo : search) { artifacts.add(artifactInfo.artifactId); } } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); bq.add(new BooleanClause((indexer.constructQuery(ArtifactInfo.SHA1, sha1)), BooleanClause.Occur.SHOULD)); Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); infos.addAll(convertToNBVersionInfo(search)); } finally { unloadIndexingContext(allrepos); } return null; } });
public Object run() throws Exception { checkIndexAvailability(allrepos); loadIndexingContext(allrepos); try { BooleanQuery bq = new BooleanQuery(); bq.add(new BooleanClause((indexer.constructQuery(ArtifactInfo.MD5, (md5))), BooleanClause.Occur.SHOULD)); Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); infos.addAll(convertToNBVersionInfo(search)); } finally { unloadIndexingContext(allrepos); } return null; } });
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)); } }
FlatSearchResponse response = indexer.searchFlat(request);
Collection<ArtifactInfo> search = indexer.searchFlat(ArtifactInfo.VERSION_COMPARATOR, bq); infos.addAll(convertToNBVersionInfo(search)); } finally {
FlatSearchResponse result = nexusIndexer.searchFlat( req );
FlatSearchResponse result = nexusIndexer.searchFlat( req );
FlatSearchResponse result = nexusIndexer.searchFlat( req );
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; }