Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

patches to ensure that solr connectors are active ony if they have a solr object assigned and vice versa

orbiter05a3ffd03ab1
diff --git a/htroot/IndexControlRWIs_p.java b/htroot/IndexControlRWIs_p.java
index 40b9246b8..6183a0c77 100644
--- a/htroot/IndexControlRWIs_p.java
+++ b/htroot/IndexControlRWIs_p.java
@@ -61,7 +61,6 @@ import net.yacy.peers.Seed;
import net.yacy.peers.dht.PeerSelection;
import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard;
-import net.yacy.search.SwitchboardConstants;
import net.yacy.search.index.Segment;
import net.yacy.search.query.QueryParams;
import net.yacy.search.query.RWIProcess;
@@ -92,8 +91,7 @@ public class IndexControlRWIs_p {
prop.put("keyhash", "");
prop.put("result", "");
prop.put("cleanup", post == null || post.containsKey("maxReferencesLimit") ? 1 : 0);
- prop.put("cleanup_solr", sb.index.getRemoteSolr() == null
- || !sb.getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, false) ? 0 : 1);
+ prop.put("cleanup_solr", sb.index.getRemoteSolr() == null ? 0 : 1);
// switch off all optional forms/lists
prop.put("searchresult", 0);
@@ -158,8 +156,7 @@ public class IndexControlRWIs_p {
if ( post.get("deleteIndex", "").equals("on") ) {
segment.clear();
}
- if ( post.get("deleteSolr", "").equals("on")
- && sb.getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, false) ) {
+ if ( post.get("deleteSolr", "").equals("on") && sb.index.getRemoteSolr() != null) {
try {
sb.index.getRemoteSolr().clear();
} catch ( final Exception e ) {
diff --git a/htroot/IndexFederated_p.java b/htroot/IndexFederated_p.java
index d0d738ac8..5e081b9d1 100644
--- a/htroot/IndexFederated_p.java
+++ b/htroot/IndexFederated_p.java
@@ -113,11 +113,11 @@ public class IndexFederated_p {
solr.setCommitWithinMs(commitWithinMs);
sb.index.connectRemoteSolr(solr);
} else {
- sb.index.connectRemoteSolr(null);
+ sb.index.disconnectRemoteSolr();
}
} catch (final IOException e) {
Log.logException(e);
- sb.index.connectRemoteSolr(null);
+ sb.index.disconnectRemoteSolr();
}
}
diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java
index f381602a1..7bcf00a5c 100644
--- a/source/net/yacy/search/Switchboard.java
+++ b/source/net/yacy/search/Switchboard.java
@@ -2408,8 +2408,8 @@ public final class Switchboard extends serverSwitch
return new indexingQueueEntry(in.queueEntry, in.documents, null);
}
- boolean localSolr = this.index.getLocalSolr() != null && getConfig(SwitchboardConstants.FEDERATED_SERVICE_YACY_INDEXING_ENGINE, "classic").equals("solr");
- boolean remoteSolr = this.index.getRemoteSolr() != null && getConfigBool(SwitchboardConstants.FEDERATED_SERVICE_SOLR_INDEXING_ENABLED, false);
+ boolean localSolr = this.index.getLocalSolr() != null;
+ boolean remoteSolr = this.index.getRemoteSolr() != null;
if (localSolr || remoteSolr) {
// send the documents to solr
for ( final Document doc : in.documents ) {