Package org.apache.maven.archiva.indexer.search

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


         * present in the full text search.
         */

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

        SearchResultLimits limits = new SearchResultLimits( 0 );

        results = crossRepoSearch.searchForTerm( q, limits );

        if ( results.isEmpty() )
        {
View Full Code Here


         * present in the full text search.
         */

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

        SearchResultLimits limits = new SearchResultLimits( 0 );
       
        List<String> selectedRepos = getObservableRepos();
        if ( CollectionUtils.isEmpty( selectedRepos ) )
        {
            return GlobalResults.ACCESS_TO_NO_REPOS;
View Full Code Here

         * present in the full text search.
         */

        assert q != null && q.length() != 0;
       
        SearchResultLimits limits = new SearchResultLimits( currentPage );
       
        List<String> selectedRepos = getObservableRepos();
        if ( CollectionUtils.isEmpty( selectedRepos ) )
        {
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        if( isBytecodeSearch( q ) )
        {  
            results = crossRepoSearch.searchForBytecode( getPrincipal(), selectedRepos, removeKeyword( q ), limits );
        }
        else
        {
            if( searchResultsOnly && !completeQueryString.equals( "" ) )
            {
                results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits, parseCompleteQueryString() );
            }
            else
            {
                completeQueryString = "";
                results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits );
            }
        }
       
        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

       
        List<String> selectedRepos = new ArrayList<String>();
        selectedRepos.add( "test-repo" );
       
        // search for class names
        SearchResults results = searcher.searchForBytecode( "", selectedRepos, "FirstPackageApp", new SearchResultLimits( 0 ) );
        assertEquals( 1, results.getTotalHits() );
       
        results = searcher.searchForBytecode( "", selectedRepos, "SecondPackageApp", new SearchResultLimits( 0 ) );
        assertEquals( 1, results.getTotalHits() );
      
        // search for public methods
        results = searcher.searchForBytecode( "", selectedRepos, "appMethodOne", new SearchResultLimits( 0 ) );
        assertEquals( 1, results.getTotalHits() );
       
        // should return only the overridding public method in SecondPackageApp
        results = searcher.searchForBytecode( "", selectedRepos, "protectedMethod", new SearchResultLimits( 0 ) );
        assertEquals( 1, results.getTotalHits() );
              
        // should not return any private methods
        results = searcher.searchForBytecode( "", selectedRepos, "privMethod", new SearchResultLimits( 0 ) );
        assertEquals( 0, results.getTotalHits() );
       
        // test for public variables?
    }
View Full Code Here

         * present in the full text search.
         */

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

        SearchResultLimits limits = new SearchResultLimits( 0 );

        results = crossRepoSearch.searchForTerm( q, limits );

        if ( results.isEmpty() )
        {
View Full Code Here

         * present in the full text search.
         */

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

        SearchResultLimits limits = new SearchResultLimits( 0 );

        results = crossRepoSearch.searchForTerm( q, limits );

        if ( results.isEmpty() )
        {
View Full Code Here

        {
            addActionError( "Unable to search for a blank checksum" );
            return INPUT;
        }

        SearchResultLimits limits = new SearchResultLimits( 0 );

        results = crossRepoSearch.searchForChecksum( q, limits );

        if ( results.isEmpty() )
        {
View Full Code Here

         * present in the full text search.
         */

        assert q != null && q.length() != 0;
       
        SearchResultLimits limits = new SearchResultLimits( currentPage );
       
        List<String> selectedRepos = getObservableRepos();
        if ( CollectionUtils.isEmpty( selectedRepos ) )
        {
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        if( isBytecodeSearch( q ) )
        {  
            results = crossRepoSearch.searchForBytecode( getPrincipal(), selectedRepos, removeKeyword( q ), limits );
        }
        else
        {
            if( searchResultsOnly && !completeQueryString.equals( "" ) )
            {
                results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits, parseCompleteQueryString() );
            }
            else
            {
                completeQueryString = "";
                results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits );
            }
        }
       
        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

         * present in the full text search.
         */

        assert q != null && q.length() != 0;
       
        SearchResultLimits limits = new SearchResultLimits( currentPage );
       
        List<String> selectedRepos = getObservableRepos();
        if ( CollectionUtils.isEmpty( selectedRepos ) )
        {
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        if( searchResultsOnly && !completeQueryString.equals( "" ) )
        {
            results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits, parseCompleteQueryString() );
        }
        else
        {
            completeQueryString = "";
            results = crossRepoSearch.searchForTerm( getPrincipal(), selectedRepos, q, limits );
        }
       
        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

        if ( CollectionUtils.isEmpty( managedRepositoryList ) )
        {
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        SearchResultLimits limits = new SearchResultLimits( currentPage );

        limits.setPageSize( rowCount );
        List<String> selectedRepos = new ArrayList<String>();

        if ( repositoryId.equals( "all" ) )
        {
            selectedRepos = getObservableRepos();
        }
        else
        {
            selectedRepos.add( repositoryId );
        }

        if ( CollectionUtils.isEmpty( selectedRepos ) )
        {
            return GlobalResults.ACCESS_TO_NO_REPOS;
        }

        results =
            crossRepoSearch.executeFilteredSearch( getPrincipal(), selectedRepos, groupId, artifactId, version,
                                                   className, limits );

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

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

        if ( ( results.getTotalHits() % limits.getPageSize() ) != 0 )
        {
            totalPages = totalPages + 1;
        }

        return SUCCESS;
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.indexer.search.SearchResultLimits

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.