From 046f5a03cb5f77dc72bb0e049084f7948611769d Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Fri, 21 Feb 2014 23:48:56 +0100 Subject: [PATCH] one more SolrIndexSearcher bugfix --- .../cora/federate/solr/connector/EmbeddedSolrConnector.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java index 57de40fde..136bfa23e 100644 --- a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java +++ b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java @@ -425,13 +425,12 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo public void run() { int o = offset, responseCount = 0; DocListSearcher docListSearcher = null; - SolrIndexSearcher searcher = null; while (System.currentTimeMillis() < endtime) { try { responseCount = 0; docListSearcher = new DocListSearcher(querystring, o, pagesize, CollectionSchema.id.getSolrFieldName()); responseCount = docListSearcher.response.size(); - searcher = docListSearcher.request.getSearcher(); + SolrIndexSearcher searcher = docListSearcher.request.getSearcher(); DocIterator iterator = docListSearcher.response.iterator(); for (int i = 0; i < responseCount; i++) { Document doc = searcher.doc(iterator.nextDoc(), SOLR_ID_FIELDS); @@ -441,7 +440,6 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo break; } catch (IOException e) { } finally { - if (searcher != null) try {searcher.close();} catch (IOException e) {} if (docListSearcher != null) docListSearcher.close(); } if (responseCount < pagesize) break;