]> source.dussan.org Git - archiva.git/commitdiff
make no limit working back
authorOlivier Lamy <olamy@apache.org>
Thu, 24 Apr 2014 01:52:05 +0000 (11:52 +1000)
committerOlivier Lamy <olamy@apache.org>
Thu, 24 Apr 2014 01:52:24 +0000 (11:52 +1000)
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java
archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/MavenRepositorySearchTest.java

index c126fd7403f7efb30a8a7aab15e2ae522a4b34ce..2a41526e23113ecba79bca17542ce56ba21e77e1 100644 (file)
@@ -274,7 +274,8 @@ public class MavenRepositorySearch
             request.setContexts( getIndexingContexts( indexingContextIds ) );
             if ( limits != null )
             {
-                if ( limits.getSelectedPage() < 1 )
+                // we apply limits only when first page asked
+                if ( limits.getSelectedPage() == 0 )
                 {
                     request.setCount( limits.getPageSize() * ( Math.max( 1, limits.getSelectedPage() ) ) );
                 }
index c3c8bfa0c056796f8fa74eb4072361daaca6a688..4b0d993ef2ecc5a050abe30972645aed447ac6e6 100644 (file)
@@ -879,7 +879,7 @@ public class MavenRepositorySearchTest
                                          repo.toURI().toURL().toExternalForm(),
                                          indexDirectory.toURI().toURL().toString(), search.getAllIndexCreators() );
 
-        SearchResultLimits limits = new SearchResultLimits( 0 );
+        SearchResultLimits limits = new SearchResultLimits( SearchResultLimits.ALL_PAGES );
         limits.setPageSize( 300 );
 
         EasyMock.expect( archivaConfig.getConfiguration() ).andReturn( config ).times( 1, 5 );