From: Sascha Vogt Date: Wed, 23 Apr 2014 13:42:46 +0000 (+0200) Subject: [MRM-1834] Add limit to index search query to prevent unnecessary X-Git-Tag: archiva-2.1.0~61 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c52eb2c0426bd64cfbff925ea9b4070f395f9aa4;p=archiva.git [MRM-1834] Add limit to index search query to prevent unnecessary calculations --- diff --git a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java index 235c8503b..1968cef02 100644 --- a/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java +++ b/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/search/MavenRepositorySearch.java @@ -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 );