From 4ca1b76627f1c96ef41e155e86dbdd11189b0bfb Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sat, 2 Feb 2013 07:20:56 +0100 Subject: [PATCH] less search overhead when first result set is smaller than requested --- source/net/yacy/peers/RemoteSearch.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/net/yacy/peers/RemoteSearch.java b/source/net/yacy/peers/RemoteSearch.java index 09b9e793e..14597c2a9 100644 --- a/source/net/yacy/peers/RemoteSearch.java +++ b/source/net/yacy/peers/RemoteSearch.java @@ -263,9 +263,10 @@ public class RemoteSearch extends Thread { int tmpoffset = 0; int tmpcount = 10; while (tmpoffset + tmpcount <= count && tmpcount > 0) { + int urls = 0; try { event.rankingProcess.oneFeederStarted(); - int urls = Protocol.solrQuery( + urls = Protocol.solrQuery( event, tmpoffset, tmpcount, @@ -286,6 +287,7 @@ public class RemoteSearch extends Thread { } finally { event.rankingProcess.oneFeederTerminated(); } + if (urls < tmpcount) break; // there won't be more tmpoffset += tmpcount; tmpcount = count - tmpoffset; // increase the tmpcount to get to all results in less time }