Examples of SearchResultLimits


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

        assert q != null && q.length() != 0;

        fromFilterSearch = false;

        SearchResultLimits limits = new SearchResultLimits( currentPage );

        List<String> selectedRepos = getObservableRepos();
        if ( CollectionUtils.isEmpty( selectedRepos ) )
        {
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        try
        {
            if( searchResultsOnly && !completeQueryString.equals( "" ) )
            {                      
                results = getNexusSearch().search( getPrincipal(), selectedRepos, q, limits, parseCompleteQueryString() );                  
            }
            else
            {
                completeQueryString = "";                   
                results = getNexusSearch().search( getPrincipal(), selectedRepos, q, limits, null );                   
            }
        }
        catch ( RepositorySearchException e )
        {
            addActionError( e.getMessage() );
            return ERROR;
        }

        if ( results.isEmpty() )
        {
            addActionError( "No results found" );
            return INPUT;
        }

        totalPages = results.getTotalHits() / limits.getPageSize();

        if( (results.getTotalHits() % limits.getPageSize()) != 0 )
        {
            totalPages = totalPages + 1;
        }
        // TODO: filter / combine the artifacts by version? (is that even possible with non-artifact hits?)
View Full Code Here

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

        // 2. get observable repos
        // 3. convert results to a list of Artifact objects
       
        List<Artifact> artifacts = new ArrayList<Artifact>();
        List<String> observableRepos = xmlRpcUserRepositories.getObservableRepositories();
        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
        SearchResults results = null;
       
        results = search.search( "", observableRepos, queryString, limits, null );
       
        List<SearchResultHit> hits = results.getHits();
View Full Code Here

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

        if ( StringUtils.isBlank( queryString ) )
        {
            return Collections.emptyList();
        }

        SearchResultLimits limits = new SearchResultLimits( 0 );
        try
        {
            SearchResults searchResults =
                repositorySearch.search( getPrincipal(), getObservableRepos(), queryString, limits,
                                         Collections.<String>emptyList() );
View Full Code Here

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

        List<String> repositories = searchRequest.getRepositories();
        if ( repositories == null || repositories.isEmpty() )
        {
            repositories = getObservableRepos();
        }
        SearchResultLimits limits =
            new SearchResultLimits( searchRequest.getPageSize(), searchRequest.getSelectedPage() );
        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), repositories, queryString, limits,
                                                                   Collections.<String>emptyList() );
            return getArtifacts( searchResults );
View Full Code Here

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

        if ( searchRequest == null )
        {
            return Collections.emptyList();
        }
        SearchFields searchField = getModelMapper().map( searchRequest, SearchFields.class );
        SearchResultLimits limits = new SearchResultLimits( 0 );

        // if no repos set we use ones available for the user
        if ( searchField.getRepositories() == null || searchField.getRepositories().isEmpty() )
        {
            searchField.setRepositories( getObservableRepos() );
View Full Code Here

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

        if ( StringUtils.isBlank( queryString ) )
        {
            return Collections.emptyList();
        }

        SearchResultLimits limits = new SearchResultLimits( 0 );
        List<String> observableRepoIds = getObservableRepos();
        try
        {
            SearchResults searchResults =
                repositorySearch.search( getPrincipal(), getObservableRepos(), queryString, limits,
View Full Code Here

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

        if ( searchRequest == null )
        {
            return Collections.emptyList();
        }
        SearchFields searchField = new BeanReplicator().replicateBean( searchRequest, SearchFields.class );
        SearchResultLimits limits = new SearchResultLimits( 0 );

        try
        {
            SearchResults searchResults = repositorySearch.search( getPrincipal(), searchField, limits );
            return getArtifacts( searchResults );
View Full Code Here

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

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

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

        SearchResultHit hit = new SearchResultHit();
        hit.setGroupId("org.apache.archiva");
        hit.setArtifactId("archiva-configuration");
        hit.setUrl("url");
View Full Code Here

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

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

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

        SearchResultHit hit = new SearchResultHit();
        hit.setGroupId("org.apache.archiva");
        hit.setArtifactId("archiva-configuration");
        hit.setUrl("url");
View Full Code Here

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

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

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

        SearchResults results = new SearchResults();

        userReposControl.expectAndReturn(userRepos.getObservableRepositoryIds("user"), selectedRepos);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.