Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
better handling of on/off switched solr indexing
orbiter039126cfaf2c
diff --git a/htroot/IndexControlRWIs_p.java b/htroot/IndexControlRWIs_p.javaindex b0f7a06d6..fe8b831af 100644--- a/htroot/IndexControlRWIs_p.java+++ b/htroot/IndexControlRWIs_p.java@@ -84,7 +84,7 @@ public class IndexControlRWIs_p {prop.put("keyhash", "");prop.put("result", "");prop.put("cleanup", post == null ? 1 : 0);- prop.put("cleanup_solr", sb.solrConnector == null ? 0 : 1);+ prop.put("cleanup_solr", sb.solrConnector == null || !sb.getConfigBool("federated.service.solr.indexing.enabled", false) ? 0 : 1);String segmentName = sb.getConfig(SwitchboardConstants.SEGMENT_PUBLIC, "default");int i = 0;@@ -154,8 +154,10 @@ public class IndexControlRWIs_p {if (post.get("deleteIndex", "").equals("on")) {segment.clear();}- if (post.get("deleteSolr", "").equals("on")) {+ if (post.get("deleteSolr", "").equals("on") && sb.getConfigBool("federated.service.solr.indexing.enabled", false)) try {sb.solrConnector.clear();+ } catch (Exception e) {+ Log.logException(e);}if (post.get("deleteCrawlQueues", "").equals("on")) {sb.crawlQueues.clear();diff --git a/source/de/anomic/search/Switchboard.java b/source/de/anomic/search/Switchboard.javaindex 965e7be91..ffd444c6c 100644--- a/source/de/anomic/search/Switchboard.java+++ b/source/de/anomic/search/Switchboard.java@@ -1245,7 +1245,7 @@ public final class Switchboard extends serverSwitch {Cache.close();tables.close();Domains.close();- if (solrConnector != null) solrConnector.close();+ if (solrConnector != null && this.getConfigBool("federated.service.solr.indexing.enabled", false)) solrConnector.close();AccessTracker.dumpLog(new File("DATA/LOG/queries.log"));UPnP.deletePortMapping();Tray.removeTray();@@ -1922,7 +1922,7 @@ public final class Switchboard extends serverSwitch {public indexingQueueEntry condenseDocument(final indexingQueueEntry in) {in.queueEntry.updateStatus(Response.QUEUE_STATE_CONDENSING);- if (this.solrConnector != null /*in.queueEntry.profile().pushSolr()*/) {+ if (this.solrConnector != null && this.getConfigBool("federated.service.solr.indexing.enabled", false)/*in.queueEntry.profile().pushSolr()*/) {// send the documents to solrfor (Document doc: in.documents) {try {diff --git a/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java b/source/net/yacy/kelondro/workflow/AbstractBlockingThread.javaindex a1860c2b6..105fd16a2 100644--- a/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java+++ b/source/net/yacy/kelondro/workflow/AbstractBlockingThread.java@@ -80,6 +80,7 @@ public abstract class AbstractBlockingThread<J extends WorkflowJob> extends Abstthis.running = false;break;} catch (final Exception e) {+ Log.logException(e);// handle exceptions: thread must not die on any unexpected exceptions// if the exception is too bad it should call terminate()this.jobExceptionHandler(e);