From c52eb2c0426bd64cfbff925ea9b4070f395f9aa4 Mon Sep 17 00:00:00 2001 From: Sascha Vogt Date: Wed, 23 Apr 2014 15:42:46 +0200 Subject: [MRM-1834] Add limit to index search query to prevent unnecessary calculations --- .../java/org/apache/archiva/indexer/search/MavenRepositorySearch.java | 1 + 1 file changed, 1 insertion(+) (limited to 'archiva-modules') 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 ); -- cgit v1.2.3