better handling of on/off switched solr indexing

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7709 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent dc54915df4
commit 039126cfaf

@ -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();

@ -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 solr
for (Document doc: in.documents) {
try {

@ -80,6 +80,7 @@ public abstract class AbstractBlockingThread<J extends WorkflowJob> extends Abst
this.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);

Loading…
Cancel
Save