Package org.apache.archiva.indexer.search

Examples of org.apache.archiva.indexer.search.SearchResults


        SearchResultLimits limits = new SearchResultLimits( 0 );
        List<String> observableRepoIds = getObservableRepos();
        try
        {
            SearchResults searchResults =
                repositorySearch.search( getPrincipal(), getObservableRepos(), queryString, limits,
                                         Collections.<String>emptyList() );
            return getArtifacts( searchResults );

        }
View Full Code Here


        searchField.setPackaging( StringUtils.isBlank( packaging ) ? "jar" : packaging );
        searchField.setRepositories( getObservableRepos() );

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, null );
            return getArtifacts( searchResults );
        }
        catch ( RepositorySearchException e )
        {
            log.error( e.getMessage(), e );
View Full Code Here

            searchField.setRepositories( getObservableRepos() );
        }

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, limits );
            return getArtifacts( searchResults );
        }
        catch ( RepositorySearchException e )
        {
            log.error( e.getMessage(), e );
View Full Code Here

        hit.setArtifactId("archiva-configuration");
        hit.setUrl("url");
        hit.addVersion("1.0");
        hit.addVersion("1.1");

        SearchResults results = new SearchResults();
        results.setLimits(limits);
        results.setTotalHits(1);
        results.addHit(SearchUtil.getHitId("org.apache.archiva", "archiva-configuration", null, "jar"), hit);
        results.setTotalHitsMapSize( results.getHitsMap().values().size() );

        userReposControl.expectAndReturn(userRepos.getObservableRepositoryIds("user"), selectedRepos);

        searchControl.expectAndReturn(search.search("user", selectedRepos, "archiva", limits, null), results);
View Full Code Here

        hit.setArtifactId("archiva-configuration");
        hit.setUrl("url");
        hit.addVersion("1.0");
        hit.addVersion("1.1");

        SearchResults results = new SearchResults();
        results.setLimits(limits);
        results.setTotalHits(1);
        results.addHit(SearchUtil.getHitId("org.apache.archiva", "archiva-configuration", null, "jar"), hit);
        results.setTotalHitsMapSize( results.getHitsMap().values().size() );
        userReposControl.expectAndReturn(userRepos.getObservableRepositoryIds("user"), selectedRepos);

        searchControl.expectAndReturn(search.search("user", selectedRepos, "archiva", limits, parsed), results);

        userReposControl.replay();
View Full Code Here

        selectedRepos.add("snapshots");

        SearchResultLimits limits = new SearchResultLimits(action.getCurrentPage());
        limits.setPageSize(30);

        SearchResults results = new SearchResults();

        userReposControl.expectAndReturn(userRepos.getObservableRepositoryIds("user"), selectedRepos);

        searchControl.expectAndReturn(search.search("user", selectedRepos, "archiva", limits, null), results);
View Full Code Here

        hit.setArtifactId("archiva-configuration");
        hit.setUrl("url");
        hit.addVersion("1.0");
        hit.addVersion("1.1");

        SearchResults results = new SearchResults();
        results.setLimits(limits);
        results.setTotalHits(1);
        results.addHit(SearchUtil.getHitId("org.apache.archiva", "archiva-configuration", null, "jar"), hit);

        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add("internal");
        selectedRepos.add("snapshots");
View Full Code Here

        hit.setArtifactId("archiva-configuration");
        hit.setUrl("url");
        hit.addVersion("1.0");
        hit.addVersion("1.1");

        SearchResults results = new SearchResults();
        results.setLimits(limits);
        results.setTotalHits(1);
        results.addHit(SearchUtil.getHitId("org.apache.archiva", "archiva-configuration", null, "jar"), hit);

        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add("internal");

        SearchFields searchFields = new SearchFields("org", null, null, null, null, selectedRepos);
View Full Code Here

        action.setGroupId("org");

        SearchResultLimits limits = new SearchResultLimits(action.getCurrentPage());
        limits.setPageSize(30);

        SearchResults results = new SearchResults();

        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add("internal");
        selectedRepos.add("snapshots");
View Full Code Here

        throws Exception
    {
        List<Artifact> artifacts = new ArrayList<Artifact>();
        List<String> observableRepos = xmlRpcUserRepositories.getObservableRepositories();
        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
        SearchResults results;

        results = search.search( "", observableRepos, queryString, limits, null );

        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            for ( SearchResultHit resultHit : results.getHits() )
            {
                List<String> resultHitVersions = resultHit.getVersions();
                if ( resultHitVersions != null )
                {
                    for ( String version : resultHitVersions )
View Full Code Here

TOP

Related Classes of org.apache.archiva.indexer.search.SearchResults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.