Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- allow lazy initialization of solr value (if using 'lazy', then no 0-values and no empty strings are written). This may save a lot of memory (in ram and on disc) if excessive 0-values or empty strings appear) - do not allow default boolean values for checkboxes because that does not make sense: browsers may omit the checkbox attribute name if the box is not checked. A default value 'true' would not comply with the semantic of the browsers response. - add a checkbox in IndexFederated_p for the lazy initialization of solr fields.
Michael Peter Christen9116013c6406
diff --git a/defaults/yacy.init b/defaults/yacy.initindex 9f6e397e5..84e4656a0 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -1052,7 +1052,9 @@ federated.service.solr.indexing.enabled = falsefederated.service.solr.indexing.url = http://127.0.0.1:8983/solrfederated.service.solr.indexing.commitWithinMs = 1000federated.service.solr.indexing.sharding = MODULO_HOST_MD5-federated.service.solr.indexing.schemefile = solr.keys.default.list+federated.service.solr.indexing.schemefile = solr.keys.default.list+# the lazy attribute causes that fields containing "" or 0 are not added and not written+federated.service.solr.indexing.lazy = true# the indexing engine in YaCy can be switched off or on# (off may make sense if federated.service.solr.indexing.enabled = true)diff --git a/htroot/AccessPicture_p.java b/htroot/AccessPicture_p.javaindex 0c8bfcb79..4959728f9 100644--- a/htroot/AccessPicture_p.java+++ b/htroot/AccessPicture_p.java@@ -64,7 +64,7 @@ public class AccessPicture_p {color_grid = post.get("colorgrid", color_grid);color_dot = post.get("colordot", color_dot);color_line = post.get("colorline", color_line);- corona = post.getBoolean("corona", true);+ corona = !post.containsKey("corona") || post.getBoolean("corona");coronaangle = (corona) ? post.getInt("coronaangle", 0) : -1;}if (coronaangle < 0) corona = false;diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.javaindex 8555889dd..5dbe872a0 100644--- a/htroot/ConfigPortal.java+++ b/htroot/ConfigPortal.java@@ -77,29 +77,29 @@ public class ConfigPortal {sb.setConfig(SwitchboardConstants.SEARCH_ITEMS, post.getInt("maximumRecords", 10));sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, ""));HTTPDFileHandler.indexForward = post.get(SwitchboardConstants.INDEX_FORWARD, "");- sb.setConfig("publicTopmenu", post.getBoolean("publicTopmenu", true));- sb.setConfig("publicSearchpage", post.getBoolean("publicSearchpage", true));- sb.setConfig("search.options", post.getBoolean("search.options", false));-- sb.setConfig("interaction.userlogon.enabled", post.getBoolean("interaction.userlogon", false));-- sb.setConfig("search.text", post.getBoolean("search.text", false));- sb.setConfig("search.image", post.getBoolean("search.image", false));- sb.setConfig("search.audio", post.getBoolean("search.audio", false));- sb.setConfig("search.video", post.getBoolean("search.video", false));- sb.setConfig("search.app", post.getBoolean("search.app", false));-- sb.setConfig("search.result.show.date", post.getBoolean("search.result.show.date", false));- sb.setConfig("search.result.show.size", post.getBoolean("search.result.show.size", false));- sb.setConfig("search.result.show.metadata", post.getBoolean("search.result.show.metadata", false));- sb.setConfig("search.result.show.parser", post.getBoolean("search.result.show.parser", false));- sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures", false));- sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache", false));- sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy", false));- sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags", false));+ sb.setConfig("publicTopmenu", !post.containsKey("publicTopmenu") || post.getBoolean("publicTopmenu"));+ sb.setConfig("publicSearchpage", !post.containsKey("publicSearchpage") || post.getBoolean("publicSearchpage"));+ sb.setConfig("search.options", post.getBoolean("search.options"));++ sb.setConfig("interaction.userlogon.enabled", post.getBoolean("interaction.userlogon"));++ sb.setConfig("search.text", post.getBoolean("search.text"));+ sb.setConfig("search.image", post.getBoolean("search.image"));+ sb.setConfig("search.audio", post.getBoolean("search.audio"));+ sb.setConfig("search.video", post.getBoolean("search.video"));+ sb.setConfig("search.app", post.getBoolean("search.app"));++ sb.setConfig("search.result.show.date", post.getBoolean("search.result.show.date"));+ sb.setConfig("search.result.show.size", post.getBoolean("search.result.show.size"));+ sb.setConfig("search.result.show.metadata", post.getBoolean("search.result.show.metadata"));+ sb.setConfig("search.result.show.parser", post.getBoolean("search.result.show.parser"));+ sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures"));+ sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache"));+ sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy"));+ sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags"));sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist"));- sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete", false));+ sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, post.getBoolean("search.verify.delete"));sb.setConfig("about.headline", post.get("about.headline", ""));sb.setConfig("about.body", post.get("about.body", ""));@@ -110,10 +110,10 @@ public class ConfigPortal {// construct navigation StringString nav = "";- if (post.getBoolean("search.navigation.hosts", false)) nav += "hosts,";- if (post.getBoolean("search.navigation.authors", false)) nav += "authors,";- if (post.getBoolean("search.navigation.namespace", false)) nav += "namespace,";- if (post.getBoolean("search.navigation.topics", false)) nav += "topics,";+ if (post.getBoolean("search.navigation.hosts")) nav += "hosts,";+ if (post.getBoolean("search.navigation.authors")) nav += "authors,";+ if (post.getBoolean("search.navigation.namespace")) nav += "namespace,";+ if (post.getBoolean("search.navigation.topics")) nav += "topics,";if (nav.endsWith(",")) nav = nav.substring(0, nav.length() - 1); sb.setConfig("search.navigation", nav);}if (post.containsKey("searchpage_default")) {@@ -164,7 +164,7 @@ public class ConfigPortal {prop.put("search.options", sb.getConfigBool("search.options", false) ? 1 : 0);prop.put("interaction.userlogon", sb.getConfigBool("interaction.userlogon.enabled", false) ? 1 : 0);-+prop.put("search.text", sb.getConfigBool("search.text", false) ? 1 : 0);prop.put("search.image", sb.getConfigBool("search.image", false) ? 1 : 0);prop.put("search.audio", sb.getConfigBool("search.audio", false) ? 1 : 0);diff --git a/htroot/ConfigUpdate_p.java b/htroot/ConfigUpdate_p.javaindex 25f04514a..315102c05 100644--- a/htroot/ConfigUpdate_p.java+++ b/htroot/ConfigUpdate_p.java@@ -149,7 +149,7 @@ public class ConfigUpdate_p {sb.setConfig("update.cycle", Math.max(12, post.getLong("cycle", 168)));sb.setConfig("update.blacklist", post.get("blacklist", ""));sb.setConfig("update.concept", ("any".equals(post.get("releaseType", "any"))) ? "any" : "main");- sb.setConfig("update.onlySignedFiles", (post.getBoolean("onlySignedFiles", false)) ? "1" : "0");+ sb.setConfig("update.onlySignedFiles", (post.getBoolean("onlySignedFiles")) ? "1" : "0");}}diff --git a/htroot/Connections_p.java b/htroot/Connections_p.javaindex 047f54604..3068527c1 100644--- a/htroot/Connections_p.java+++ b/htroot/Connections_p.java@@ -30,6 +30,9 @@import java.io.UnsupportedEncodingException;import java.net.InetAddress;import java.net.URLEncoder;+import java.util.Collections;+import java.util.LinkedList;+import java.util.List;import java.util.Set;import net.yacy.cora.protocol.ConnectionInfo;@@ -43,12 +46,9 @@ import de.anomic.server.serverCore;import de.anomic.server.serverCore.Session;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;-import java.util.Collections;-import java.util.LinkedList;-import java.util.List;-public final class Connections_p {-+public final class Connections_p {+public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {// return variable that accumulates replacementsfinal Switchboard sb = (Switchboard) env;@@ -57,44 +57,44 @@ public final class Connections_p {// server sessions// get the serverCore threadfinal WorkflowThread httpd = sb.getThread("10_httpd");-- // determines if name lookup should be done or not++ // determines if name lookup should be done or notfinal boolean doNameLookup;- if (post != null) {- doNameLookup = (post.containsKey("nameLookup") && post.getBoolean("nameLookup", true));+ if (post != null) {+ doNameLookup = post.getBoolean("nameLookup");if (post.containsKey("closeServerSession")) {final String sessionName = post.get("closeServerSession", null);sb.closeSessions("10_httpd", sessionName);prop.put("LOCATION","");- return prop;+ return prop;}} else {doNameLookup = false;}-+// waiting for all threads to finishint idx = 0, numActiveRunning = 0, numActivePending = 0;boolean dark = true;for (final Session s: ((serverCore) httpd).getJobList()) {if (!s.isAlive()) continue;-+// get the session runtimefinal long sessionTime = s.getTime();-+// get the request command lineString commandLine = s.getCommandLine();final boolean blockingRequest = (commandLine == null);final int commandCount = s.getCommandCount();-+// get the source ip address and portfinal InetAddress userAddress = s.getUserAddress();final int userPort = s.getUserPort();if (userAddress == null) {continue;}-+String prot = "http"; // only httpd sessions listed-+// determining if the source is a yacy hostSeed seed = null;if (doNameLookup) {@@ -104,7 +104,7 @@ public final class Connections_p {seed = null;}}-+prop.put("list_" + idx + "_dark", dark ? "1" : "0");dark = !dark;try {@@ -135,20 +135,20 @@ public final class Connections_p {}prop.putNum("list_" + idx + "_used", commandCount);idx++;- }+ }prop.put("list", idx);-+prop.putNum("numMax", ((serverCore)httpd).getMaxSessionCount());prop.putNum("numActiveRunning", numActiveRunning);prop.putNum("numActivePending", numActivePending);-+// client sessionsfinal Set<ConnectionInfo> allConnections = ConnectionInfo.getAllConnections();// sorting: sort by initTime, decendingList<ConnectionInfo> allConnectionsSorted = new LinkedList<ConnectionInfo>(allConnections);Collections.sort(allConnectionsSorted);Collections.reverse(allConnectionsSorted); // toggle ascending/descending-+int c = 0;synchronized (allConnectionsSorted) {for (final ConnectionInfo conInfo: allConnectionsSorted) {@@ -163,7 +163,7 @@ public final class Connections_p {}prop.put("clientList", c);prop.put("clientActive", ConnectionInfo.getCount());-+// return rewrite values for templatesreturn prop;}diff --git a/htroot/Crawler_p.java b/htroot/Crawler_p.javaindex 74c89f991..ceacd2286 100644--- a/htroot/Crawler_p.java+++ b/htroot/Crawler_p.java@@ -182,7 +182,7 @@ public class Crawler_p {String ipMustMatch = post.get("ipMustmatch", CrawlProfile.MATCH_ALL_STRING);final String ipMustNotMatch = post.get("ipMustnotmatch", CrawlProfile.MATCH_NEVER_STRING);if (ipMustMatch.length() < 2) ipMustMatch = CrawlProfile.MATCH_ALL_STRING;- final String countryMustMatch = post.getBoolean("countryMustMatchSwitch", false) ? post.get("countryMustMatchList", "") : "";+ final String countryMustMatch = post.getBoolean("countryMustMatchSwitch") ? post.get("countryMustMatchList", "") : "";sb.setConfig("crawlingIPMustMatch", ipMustMatch);sb.setConfig("crawlingIPMustNotMatch", ipMustNotMatch);if (countryMustMatch.length() > 0) sb.setConfig("crawlingCountryMustMatch", countryMustMatch);diff --git a/htroot/IndexFederated_p.html b/htroot/IndexFederated_p.htmlindex 4ae4a2e7b..ea6897ce3 100644--- a/htroot/IndexFederated_p.html+++ b/htroot/IndexFederated_p.html@@ -36,7 +36,6 @@<input type="checkbox" name="solr.indexing.solrremote" id="solr.indexing.solrremote" #(solr.indexing.solrremote.checked)#:: checked="checked"#(/solr.indexing.solrremote.checked)# /><label for="p2p">Remote Solr Search Index</label></legend>- You can set one or more Solr targets here. If you wish to set several targets, then list them in the 'Solr URL' field using a ',' (comma) as separator.<div align="left"><dl>@@ -60,13 +59,17 @@</dd>#(/table)#<dt class="TableCellDark">Solr URL(s)</dt>- <dd><textarea rows="5" cols="80" name="solr.indexing.url" id="solr.indexing.url"/>#[solr.indexing.url]#</textarea></dd>+ <dd><textarea rows="2" cols="80" name="solr.indexing.url" id="solr.indexing.url"/>#[solr.indexing.url]#</textarea><br/>+ You can set one or more Solr targets here which are accessed as a shard. For several targets, list them using a ',' (comma) as separator.</dd><dt class="TableCellDark">Commit-Within (milliseconds)</dt>- <dd><input type="text" size="6" maxlength="6" value="#[solr.indexing.commitWithinMs]#" name="solr.indexing.commitWithinMs" id="solr.indexing.commitWithinMs"/></dd>+ <dd><input type="text" size="6" maxlength="6" value="#[solr.indexing.commitWithinMs]#" name="solr.indexing.commitWithinMs" id="solr.indexing.commitWithinMs"/> (increase this value to i.e. 180000 - 3 minutes - for more performance)</dd>+ <dt class="TableCellDark">Lazy Value Initialization</dt>+ <dd><input type="checkbox" name="solr.indexing.lazy" id="solr.indexing.lazy" #(solr.indexing.lazy.checked)#:: checked="checked"#(/solr.indexing.lazy.checked)# /> (if checked, only non-zero values and non-empty strings are written)</dd><dt class="TableCellDark">Sharding Method</dt><dd><input type="text" size="50" maxlength="50" value="#[solr.indexing.sharding]#" name="solr.indexing.sharding" id="solr.indexing.sharding" disabled="disabled"/></dd><dt class="TableCellDark">Scheme</dt><dd><input type="text" size="50" maxlength="50" value="#[solr.indexing.schemefile]#" name="solr.indexing.schemefile" id="solr.indexing.schemefile" disabled="disabled"/></dd>+ <dt></dt><dd><input type="submit" name="set" value="Set" /></dd></dl></div><div>diff --git a/htroot/IndexFederated_p.java b/htroot/IndexFederated_p.javaindex aca303562..514f2073a 100644--- a/htroot/IndexFederated_p.java+++ b/htroot/IndexFederated_p.java@@ -56,10 +56,11 @@ public class IndexFederated_p {// solrfinal boolean solrWasOn = env.getConfigBool("federated.service.solr.indexing.enabled", true);- final boolean solrIsOnAfterwards = post.getBoolean("solr.indexing.solrremote", false);+ final boolean solrIsOnAfterwards = post.getBoolean("solr.indexing.solrremote");env.setConfig("federated.service.solr.indexing.enabled", solrIsOnAfterwards);String solrurls = post.get("solr.indexing.url", env.getConfig("federated.service.solr.indexing.url", "http://127.0.0.1:8983/solr"));int commitWithinMs = post.getInt("solr.indexing.commitWithinMs", env.getConfigInt("federated.service.solr.indexing.commitWithinMs", 180000));+ boolean lazy = post.getBoolean("solr.indexing.lazy");final BufferedReader r = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(UTF8.getBytes(solrurls))));final StringBuilder s = new StringBuilder();String s0;@@ -78,6 +79,7 @@ public class IndexFederated_p {solrurls = s.toString().trim();env.setConfig("federated.service.solr.indexing.url", solrurls);env.setConfig("federated.service.solr.indexing.commitWithinMs", commitWithinMs);+ env.setConfig("federated.service.solr.indexing.lazy", lazy);env.setConfig("federated.service.solr.indexing.sharding", post.get("solr.indexing.sharding", env.getConfig("federated.service.solr.indexing.sharding", "modulo-host-md5")));final String schemename = post.get("solr.indexing.schemefile", env.getConfig("federated.service.solr.indexing.schemefile", "solr.keys.default.list"));env.setConfig("federated.service.solr.indexing.schemefile", schemename);@@ -188,6 +190,7 @@ public class IndexFederated_p {prop.put("solr.indexing.solrremote.checked", env.getConfigBool("federated.service.solr.indexing.enabled", false) ? 1 : 0);prop.put("solr.indexing.url", env.getConfig("federated.service.solr.indexing.url", "http://127.0.0.1:8983/solr").replace(",", "\n"));prop.put("solr.indexing.commitWithinMs", env.getConfigInt("federated.service.solr.indexing.commitWithinMs", 180000));+ prop.put("solr.indexing.lazy.checked", env.getConfigBool("federated.service.solr.indexing.lazy", true) ? 1 : 0);prop.put("solr.indexing.sharding", env.getConfig("federated.service.solr.indexing.sharding", "modulo-host-md5"));prop.put("solr.indexing.schemefile", schemename);diff --git a/htroot/NetworkPicture.java b/htroot/NetworkPicture.javaindex d0840a57c..bd4012ad9 100644--- a/htroot/NetworkPicture.java+++ b/htroot/NetworkPicture.java@@ -90,7 +90,7 @@ public class NetworkPicturepassiveLimit = post.getInt("pal", passiveLimit);potentialLimit = post.getInt("pol", potentialLimit);maxCount = post.getInt("max", maxCount);- corona = post.getBoolean("corona", true);+ corona = !post.containsKey("corona") || post.getBoolean("corona");coronaangle = (corona) ? post.getInt("coronaangle", 0) : -1;communicationTimeout = post.getLong("ct", -1);bgcolor = post.get("bgcolor", bgcolor);diff --git a/htroot/PeerLoadPicture.java b/htroot/PeerLoadPicture.javaindex b97a36f0f..6c1030afe 100644--- a/htroot/PeerLoadPicture.java+++ b/htroot/PeerLoadPicture.java@@ -8,47 +8,46 @@ import net.yacy.kelondro.workflow.BusyThread;import net.yacy.peers.graphics.NetworkGraph;import net.yacy.peers.graphics.NetworkGraph.CircleThreadPiece;import net.yacy.search.SwitchboardConstants;-import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;public class PeerLoadPicture {-+public static Image respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {int width = 800;int height = 600;boolean showidle = true;-+if (post != null) {width = post.getInt("width", 800);height = post.getInt("height", 600);- showidle = post.getBoolean("showidle", true);+ showidle = post.getBoolean("showidle");}-+final CircleThreadPiece idle = new CircleThreadPiece("Idle", new Color(170, 255, 170));final CircleThreadPiece misc = new CircleThreadPiece("Misc.", new Color(190, 50, 180));final HashMap<String, CircleThreadPiece> pieces = new HashMap<String, CircleThreadPiece>();pieces.put(null, idle);pieces.put(SwitchboardConstants.INDEX_DIST, new CircleThreadPiece("DHT-Distribution", new Color(119, 136, 153)));pieces.put(SwitchboardConstants.PEER_PING, new CircleThreadPiece("YaCy Core", new Color(255, 230, 160)));-+final Iterator<String> threads = env.threadNames();String threadname;BusyThread thread;-+long busy_time = 0;-+//Iterate over threadswhile (threads.hasNext()) {threadname = threads.next();thread = env.getThread(threadname);-+//count total timesbusy_time += thread.getBlockTime();busy_time += thread.getExecTime();if (showidle) idle.addExecTime(thread.getSleepTime());-+//count threadgroup-specific timesfinal CircleThreadPiece piece = pieces.get(threadname);if (piece == null) {@@ -58,7 +57,7 @@ public class PeerLoadPicture {}}busy_time += idle.getExecTime();-+// set respective anglesfinal Iterator<CircleThreadPiece> it = pieces.values().iterator();CircleThreadPiece current;@@ -69,7 +68,7 @@ public class PeerLoadPicture {if(current.getAngle() == 0) it.remove();}misc.setFraction(busy_time);-+// too small values lead to an error, too big to huge CPU/memory consumption,// resulting in possible DOS.if (width < 40) width = 40;diff --git a/htroot/Status.java b/htroot/Status.javaindex 0f599d57a..f672939be 100644--- a/htroot/Status.java+++ b/htroot/Status.java@@ -101,11 +101,11 @@ public class StatusByteCount.resetCount();redirect = true;} else if ( post.containsKey("popup") ) {- final boolean trigger_enabled = post.getBoolean("popup", false);+ final boolean trigger_enabled = post.getBoolean("popup");sb.setConfig("browserPopUpTrigger", trigger_enabled);redirect = true;} else if ( post.containsKey("tray") ) {- final boolean trigger_enabled = post.getBoolean("tray", false);+ final boolean trigger_enabled = post.getBoolean("tray");sb.setConfig("trayIcon", trigger_enabled);redirect = true;}diff --git a/htroot/Table_API_p.java b/htroot/Table_API_p.javaindex c6ae5e26a..d3012a36a 100644--- a/htroot/Table_API_p.java+++ b/htroot/Table_API_p.java@@ -64,7 +64,7 @@ public class Table_API_p {startRecord = 0;maximumRecords = 1000;}- final boolean inline = (post != null && post.getBoolean("inline", false));+ final boolean inline = (post != null && post.getBoolean("inline"));prop.put("inline", (inline) ? 1 : 0);diff --git a/htroot/Threaddump_p.java b/htroot/Threaddump_p.javaindex 16191fee1..dde3a6962 100644--- a/htroot/Threaddump_p.java+++ b/htroot/Threaddump_p.java@@ -1,4 +1,4 @@-// Threaddump_p.java+// Threaddump_p.java// -----------------------// part of YACY// (C) by Michael Peter Christen; [email protected]@@ -28,29 +28,28 @@import java.io.File;import java.io.IOException;+import java.util.ArrayList;import java.util.Date;import java.util.Map;-import java.util.ArrayList;import net.yacy.cora.protocol.RequestHeader;import net.yacy.kelondro.logging.ThreadDump;import net.yacy.kelondro.util.OS;import net.yacy.peers.operation.yacyBuildProperties;import net.yacy.search.Switchboard;-import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;public class Threaddump_p {public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {-+serverObjects prop = new serverObjects();Switchboard sb = (Switchboard) env;-+final StringBuilder buffer = new StringBuilder(1000);-- final boolean plain = post != null && post.getBoolean("plain", false);++ final boolean plain = post != null && post.getBoolean("plain");final int sleep = (post == null) ? 0 : post.getInt("sleep", 0); // a sleep before creation of a thread dump can be used for profilingif (sleep > 0) try {Thread.sleep(sleep);} catch (final InterruptedException e) {}prop.put("dump", "1");@@ -58,7 +57,7 @@ public class Threaddump_p {final Date dt = new Date();final String versionstring = yacyBuildProperties.getVersion() + "/" + yacyBuildProperties.getSVNRevision();Runtime runtime = Runtime.getRuntime();-+ThreadDump.bufferappend(buffer, plain, "************* Start Thread Dump " + dt + " *******************");ThreadDump.bufferappend(buffer, plain, "");ThreadDump.bufferappend(buffer, plain, "YaCy Version: " + versionstring);@@ -67,7 +66,7 @@ public class Threaddump_p {ThreadDump.bufferappend(buffer, plain, "Available Memory = " + (runtime.maxMemory() - runtime.totalMemory() + runtime.freeMemory()));ThreadDump.bufferappend(buffer, plain, "");ThreadDump.bufferappend(buffer, plain, "");-+int multipleCount = 100;File appPath = sb.getAppPath();if (post != null && post.containsKey("multipleThreaddump")) {@@ -94,7 +93,7 @@ public class Threaddump_p {ThreadDump.bufferappend(buffer, plain, "this thread dump function can find threads that lock others, to enable this function start YaCy with 'startYACY.sh -l'");ThreadDump.bufferappend(buffer, plain, "");}-+// generate a single thread dumpfinal Map<Thread,StackTraceElement[]> stackTraces = ThreadDump.getAllStackTraces();new ThreadDump(appPath, stackTraces, plain, Thread.State.BLOCKED).appendStackTraces(buffer, plain, Thread.State.BLOCKED);@@ -104,16 +103,16 @@ public class Threaddump_p {new ThreadDump(appPath, stackTraces, plain, Thread.State.NEW).appendStackTraces(buffer, plain, Thread.State.NEW);new ThreadDump(appPath, stackTraces, plain, Thread.State.TERMINATED).appendStackTraces(buffer, plain, Thread.State.TERMINATED);}-+ThreadDump.bufferappend(buffer, plain, "************* End Thread Dump " + dt + " *******************");-+prop.put("plain_count", multipleCount);prop.put("plain_content", buffer.toString());prop.put("plain", (plain) ? 1 : 0);-+return prop; // return from serverObjects respond()- }--+ }++}diff --git a/htroot/ViewFile.java b/htroot/ViewFile.javaindex d9e26ea91..c86da1110 100644--- a/htroot/ViewFile.java+++ b/htroot/ViewFile.java@@ -151,7 +151,7 @@ public class ViewFile {// define an url by post parameterurl = new DigestURI(MultiProtocolURI.unescape(urlString));urlHash = ASCII.String(url.hash());- pre = post.getBoolean("pre", false);+ pre = post.getBoolean("pre");} catch (final MalformedURLException e) {}diff --git a/htroot/api/ymarks/import_ymark.java b/htroot/api/ymarks/import_ymark.javaindex 85d9018a3..119415a04 100644--- a/htroot/api/ymarks/import_ymark.java+++ b/htroot/api/ymarks/import_ymark.java@@ -61,7 +61,7 @@ public class import_ymark {boolean merge = false;boolean empty = false;final String indexing = post.get("indexing", "off");- final boolean medialink = post.getBoolean("medialink", false);+ final boolean medialink = post.getBoolean("medialink");if(post.containsKey("autotag") && !post.get("autotag", "off").equals("off")) {autotag = true;diff --git a/htroot/opensearchdescription.java b/htroot/opensearchdescription.javaindex 82236d737..e68d4fd31 100644--- a/htroot/opensearchdescription.java+++ b/htroot/opensearchdescription.java@@ -44,7 +44,7 @@ public class opensearchdescription {if (thisaddress.indexOf(':',0) == -1) thisaddress += ":" + serverCore.getPortNr(env.getConfig("port", "8090"));int compareyacy = 0;- if (post != null && post.getBoolean("compare_yacy", false))+ if (post != null && post.getBoolean("compare_yacy"))compareyacy = 1;final serverObjects prop = new serverObjects();diff --git a/source/de/anomic/server/serverObjects.java b/source/de/anomic/server/serverObjects.javaindex 836a96d43..ecef7083d 100644--- a/source/de/anomic/server/serverObjects.java+++ b/source/de/anomic/server/serverObjects.java@@ -373,9 +373,9 @@ public class serverObjects extends HashMap<String, String> implements Cloneable}}- public boolean getBoolean(final String key, final boolean dflt) {+ public boolean getBoolean(final String key) {String s = removeByteOrderMark(super.get(key));- if (s == null) return dflt;+ if (s == null) return false;s = s.toLowerCase();return s.equals("true") || s.equals("on") || s.equals("1");}diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.javaindex 92aa5b950..edcb7a958 100644--- a/source/net/yacy/search/Switchboard.java+++ b/source/net/yacy/search/Switchboard.java@@ -398,8 +398,9 @@ public final class Switchboard extends serverSwitchif ( !solrWorkProfile.exists() ) {Files.copy(solrBackupProfile, solrWorkProfile);}- final SolrConfiguration backupScheme = new SolrConfiguration(solrBackupProfile);- this.solrScheme = new SolrConfiguration(solrWorkProfile);+ final boolean solrlazy = getConfigBool("federated.service.solr.indexing.lazy", true);+ final SolrConfiguration backupScheme = new SolrConfiguration(solrBackupProfile, solrlazy);+ this.solrScheme = new SolrConfiguration(solrWorkProfile, solrlazy);// update the working scheme with the backup scheme. This is necessary to include new features.// new features are always activated by default (if activated in input-backupScheme)diff --git a/source/net/yacy/search/index/SolrConfiguration.java b/source/net/yacy/search/index/SolrConfiguration.javaindex 201bfff67..59179ac4f 100644--- a/source/net/yacy/search/index/SolrConfiguration.java+++ b/source/net/yacy/search/index/SolrConfiguration.java@@ -58,12 +58,15 @@ public class SolrConfiguration extends ConfigurationSet implements Serializableprivate static final long serialVersionUID=-499100932212840385L;+ private boolean lazy;+/*** initialize with an empty ConfigurationSet which will cause that all the index* attributes are used*/public SolrConfiguration() {super();+ this.lazy = false;}/**@@ -72,7 +75,7 @@ public class SolrConfiguration extends ConfigurationSet implements Serializable* or keyword = value lines (while value is a custom Solr field name* @param configurationFile*/- public SolrConfiguration(final File configurationFile) {+ public SolrConfiguration(final File configurationFile, boolean lazy) {super(configurationFile);// check consistency: compare with YaCyField enumif (this.isEmpty()) return;@@ -86,22 +89,27 @@ public class SolrConfiguration extends ConfigurationSet implements Serializableit.remove();}}+ this.lazy = lazy;}protected void addSolr(final SolrDoc solrdoc, final SolrField key, final String value) {- if (isEmpty() || contains(key.name())) solrdoc.addSolr(key, value);+ if ((isEmpty() || contains(key.name())) && (!this.lazy || (value != null && value.length() > 0))) solrdoc.addSolr(key, value);}- protected void addSolr(final SolrDoc solrdoc, final SolrField key, final Date value) {- if (isEmpty() || contains(key.name())) solrdoc.addSolr(key, value);+ protected void addSolr(final SolrDoc solrdoc, final SolrField key, final String value, final float boost) {+ if ((isEmpty() || contains(key.name())) && (!this.lazy || (value != null && value.length() > 0))) solrdoc.addSolr(key, value, boost);}- protected void addSolr(final SolrDoc solrdoc, final SolrField key, final int value) {- if (isEmpty() || contains(key.name())) solrdoc.addSolr(key, value);+ protected void addSolr(final SolrDoc solrdoc, final SolrField key, final Date value) {+ if ((isEmpty() || contains(key.name())) && (!this.lazy || (value != null && value.getTime() > 0))) solrdoc.addSolr(key, value);}protected void addSolr(final SolrDoc solrdoc, final SolrField key, final String[] value) {- if (isEmpty() || contains(key.name())) solrdoc.addSolr(key, value);+ if ((isEmpty() || contains(key.name())) && (!this.lazy || (value != null && value.length > 0))) solrdoc.addSolr(key, value);+ }++ protected void addSolr(final SolrDoc solrdoc, final SolrField key, final int value) {+ if ((isEmpty() || contains(key.name())) && (!this.lazy || value > 0)) solrdoc.addSolr(key, value);}protected void addSolr(final SolrDoc solrdoc, final SolrField key, final float value) {@@ -116,10 +124,6 @@ public class SolrConfiguration extends ConfigurationSet implements Serializableif (isEmpty() || contains(key.name())) solrdoc.addSolr(key, value);}- protected void addSolr(final SolrDoc solrdoc, final SolrField key, final String value, final float boost) {- if (isEmpty() || contains(key.name())) solrdoc.addSolr(key, value, boost);- }-/*** save configuration to file and update enum SolrFields