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?)