Skip to content

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

fix for vocabulary on/off setting

Michael Peter Christen6390454652e9
diff --git a/htroot/Vocabulary_p.java b/htroot/Vocabulary_p.java
index a558bd2d0..ce62aae79 100644
--- a/htroot/Vocabulary_p.java
+++ b/htroot/Vocabulary_p.java
@@ -233,7 +233,7 @@ public class Vocabulary_p {
}
// check the isFacet property
- if (vocabulary != null) {
+ if (vocabulary != null && post.containsKey("set")) {
vocabulary.setFacet(post.getBoolean("isFacet"));
}
}
diff --git a/htroot/api/snapshot.java b/htroot/api/snapshot.java
index b75465a25..427ed00d0 100644
--- a/htroot/api/snapshot.java
+++ b/htroot/api/snapshot.java
@@ -63,7 +63,7 @@ public class snapshot {
private final static int DEFAULT_QUALITY = 75;
private final static String DEFAULT_EXT = "jpg";
- public static Object respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
+ public static Object respond(final RequestHeader header, serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env;
final boolean authenticated = sb.adminAuthenticated(header) >= 2;
@@ -101,7 +101,7 @@ public class snapshot {
}
// for the following methods we (mostly) need an url or a url hash
- if (post == null) return null;
+ if (post == null) post = new serverObjects();
final boolean xml = ext.equals("xml");
final boolean pdf = ext.equals("pdf");
if (pdf && !authenticated) return null;
diff --git a/source/net/yacy/cora/lod/vocabulary/Tagging.java b/source/net/yacy/cora/lod/vocabulary/Tagging.java
index 1426495d9..49fe5e700 100644
--- a/source/net/yacy/cora/lod/vocabulary/Tagging.java
+++ b/source/net/yacy/cora/lod/vocabulary/Tagging.java
@@ -41,6 +41,7 @@ import net.yacy.cora.geo.GeoLocation;
import net.yacy.cora.geo.Locations;
import net.yacy.cora.storage.Files;
import net.yacy.cora.util.CommonPattern;
+import net.yacy.cora.util.ConcurrentLog;
public class Tagging {
@@ -203,6 +204,9 @@ public class Tagging {
this.predicate = this.namespace + this.navigatorName;
this.objectspace = null;
+ ConcurrentLog.info("Tagging", "Started Vocabulary Initialization for " + this.propFile);
+ long start = System.currentTimeMillis();
+ long count = 0;
BlockingQueue<String> list = Files.concurentLineReader(this.propFile, 1000);
String term, v;
String[] tags;
@@ -212,6 +216,7 @@ public class Tagging {
try {
String[] pl;
vocloop: while ((line = list.take()) != Files.POISON_LINE) {
+ count++;
line = line.trim();
p = line.indexOf('#');
if (p >= 0) {
@@ -263,6 +268,7 @@ public class Tagging {
}
} catch (final InterruptedException e) {
}
+ ConcurrentLog.info("Tagging", "Finished Vocabulary Initialization for " + this.propFile + "; " + count + " lines; " + (System.currentTimeMillis() - start) + " milliseconds");
}
public boolean isFacet() {