From 74ab0945872cf301e6106d860505d24505a8ba87 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Thu, 3 Apr 2014 13:42:10 +0200 Subject: [PATCH] fix for solr query size; too many documents had been retrieved in case that less than _pagesize_ had been requested. --- .../cora/federate/solr/connector/AbstractSolrConnector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java index da013f29f..ad0dc0ef4 100644 --- a/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java +++ b/source/net/yacy/cora/federate/solr/connector/AbstractSolrConnector.java @@ -160,7 +160,7 @@ public abstract class AbstractSolrConnector implements SolrConnector { int count = 0; while (System.currentTimeMillis() < endtime && count < maxcount) { try { - SolrDocumentList sdl = getDocumentListByQuery(querystring, o, pagesize, fields); + SolrDocumentList sdl = getDocumentListByQuery(querystring, o, Math.min(maxcount, pagesize), fields); for (SolrDocument d: sdl) { try {queue.put(d);} catch (final InterruptedException e) {break;} count++; @@ -199,7 +199,7 @@ public abstract class AbstractSolrConnector implements SolrConnector { int o = offset; while (System.currentTimeMillis() < endtime) { try { - SolrDocumentList sdl = getDocumentListByQuery(querystring, o, pagesize, CollectionSchema.id.getSolrFieldName()); + SolrDocumentList sdl = getDocumentListByQuery(querystring, o, Math.min(maxcount, pagesize), CollectionSchema.id.getSolrFieldName()); for (SolrDocument d: sdl) { try {queue.put((String) d.getFieldValue(CollectionSchema.id.getSolrFieldName()));} catch (final InterruptedException e) {break;} }