]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1834] Add limit to index search query to prevent unnecessary
authorSascha Vogt <s.vogt@seeburger.de>
Wed, 23 Apr 2014 13:42:46 +0000 (15:42 +0200)
committerOlivier Lamy <olamy@apache.org>
Thu, 24 Apr 2014 01:52:24 +0000 (11:52 +1000)
calculations

archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java

index 235c8503b6f94e428b7767f9aa38398764a6690d..1968cef02d8cdbceac6a9ffed987fe20f065d31f 100644 (file)
@@ -265,6 +265,7 @@ public class MavenRepositorySearch
             FlatSearchRequest request = new FlatSearchRequest( q );
 
             request.setContexts( getIndexingContexts( indexingContextIds ) );
+            request.setCount(limits.getPageSize()*(Math.max(1, limits.getSelectedPage())));
 
             FlatSearchResponse response = indexer.searchFlat( request );