diff --git a/defaults/yacy.init b/defaults/yacy.init index 2525beda4..d0da05d69 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -813,7 +813,7 @@ search.audio = false search.video = false search.app = false -# number of search results displayed by default +# number of search results per page displayed by default search.items = 10 # target for search results; this is the href target attribute inside every search result link diff --git a/htroot/ConfigPortal.html b/htroot/ConfigPortal.html index 1533e47c4..516e4b07c 100644 --- a/htroot/ConfigPortal.html +++ b/htroot/ConfigPortal.html @@ -82,7 +82,7 @@
Default maximum number of results per page
-
max = 100 (with CACHEONLY=5000)
+
Default index.html Page (by forwarder)
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index 8e29fc3e3..a5c87b63b 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -220,14 +220,15 @@ public class yacysearch { // collect search attributes - int itemsPerPage = - Math.min( - (authenticated) - ? (snippetFetchStrategy != null && snippetFetchStrategy.isAllowedToFetchOnline() - ? 100 - : 5000) : (snippetFetchStrategy != null - && snippetFetchStrategy.isAllowedToFetchOnline() ? 20 : 1000), - post.getInt("maximumRecords", post.getInt("count", post.getInt("rows", sb.getConfigInt(SwitchboardConstants.SEARCH_ITEMS, 10))))); // SRU syntax with old property as alternative + // check an determine items per page (max of [100 or configured default]} + final int defaultItemsPerPage = sb.getConfigInt(SwitchboardConstants.SEARCH_ITEMS, 10); + int itemsPerPage = post.getInt("maximumRecords", post.getInt("count", post.getInt("rows", defaultItemsPerPage))); // requested or default // SRU syntax with old property as alternative + // whatever admin has set as default, that's always ok + if (itemsPerPage > defaultItemsPerPage && itemsPerPage > 100) { // if above hardcoded 100 limit restrict request (except default allows more) + // search option (index.html) offers up to 100 (that defines the lower limit available to request) + itemsPerPage = Math.max((snippetFetchStrategy != null && snippetFetchStrategy.isAllowedToFetchOnline() ? 100 : 1000), defaultItemsPerPage); + } + int startRecord = post.getInt("startRecord", post.getInt("offset", post.getInt("start", 0))); final boolean indexof = (post != null && post.get("indexof", "").equals("on"));