Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- reduced default search time - catched case when web structure cannot be painted because of too less data - better logging when balance fails
orbiter71fd972ac02f
diff --git a/build.properties b/build.propertiesindex 1a11630d7..f78ebaf97 100644--- a/build.properties+++ b/build.properties@@ -3,7 +3,7 @@ javacSource=1.4javacTarget=1.4# Release Configuration-releaseVersion=0.524+releaseVersion=0.525releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gzreleaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}diff --git a/htroot/WebStructurePicture_p.java b/htroot/WebStructurePicture_p.javaindex 533277726..18195e2e8 100644--- a/htroot/WebStructurePicture_p.java+++ b/htroot/WebStructurePicture_p.java@@ -81,28 +81,37 @@ public class WebStructurePicture_p {// find domain with most referenceshost = sb.webStructure.hostWithMaxReferences();}- // find start hash- String hash = null;- try {- hash = plasmaURL.urlHash(new URL("http://" + host)).substring(6);- } catch (MalformedURLException e) {e.printStackTrace();}- assert (sb.webStructure.references(hash) != null);-- // recursively find domains, up to a specific depth- ymageGraph graph = new ymageGraph();- if (host != null) place(graph, sb.webStructure, hash, host, nodes, timeout, 0.0, 0.0, 0, depth);- //graph.print();-- ymageMatrix graphPicture = graph.draw(width, height, 40, 40, 16, 16);-+ ymageMatrix graphPicture;+ if (host == null) {+ // probably no information available+ graphPicture = new ymageMatrix(width, height, ymageGraph.color_back);+ graphPicture.setMode(ymageMatrix.MODE_SUB);+ ymageToolPrint.print(graphPicture, width / 2, height / 2, 0, "NO WEB STRUCTURE DATA AVAILABLE.", 0);+ ymageToolPrint.print(graphPicture, width / 2, height / 2 + 16, 0, "START A WEB CRAWL TO OBTAIN STRUCTURE DATA.", 0);+ } else {+ // find start hash+ String hash = null;+ try {+ hash = plasmaURL.urlHash(new URL("http://" + host)).substring(6);+ } catch (MalformedURLException e) {e.printStackTrace();}+ assert (sb.webStructure.references(hash) != null);++ // recursively find domains, up to a specific depth+ ymageGraph graph = new ymageGraph();+ if (host != null) place(graph, sb.webStructure, hash, host, nodes, timeout, 0.0, 0.0, 0, depth);+ //graph.print();++ graphPicture = graph.draw(width, height, 40, 40, 16, 16);+ }// print headline- graphPicture.setColor(ymageMatrix.SUBTRACTIVE_BLACK);+ graphPicture.setColor(ymageGraph.color_text);graphPicture.setMode(ymageMatrix.MODE_SUB);ymageToolPrint.print(graphPicture, 2, 8, 0, "YACY WEB-STRUCTURE ANALYSIS", -1);- ymageToolPrint.print(graphPicture, 2, 16, 0, "LINK ENVIRONMENT OF DOMAIN " + host.toUpperCase(), -1);+ if (host != null) ymageToolPrint.print(graphPicture, 2, 16, 0, "LINK ENVIRONMENT OF DOMAIN " + host.toUpperCase(), -1);ymageToolPrint.print(graphPicture, width - 2, 8, 0, "SNAPSHOT FROM " + new Date().toString().toUpperCase(), 1);return graphPicture;+}private static final int place(ymageGraph graph, plasmaWebStructure structure, String centerhash, String centerhost, int maxnodes, long timeout, double x, double y, int nextlayer, int maxlayer) {diff --git a/htroot/index.html b/htroot/index.htmlindex eae572fad..316e84189 100644--- a/htroot/index.html+++ b/htroot/index.html@@ -33,7 +33,7 @@#(searchoptions)#<!-- default values are hard-coded<input type="hidden" name="count" value="10" /><input type="hidden" name="resource" value="global" />- <input type="hidden" name="time" value="6" />+ <input type="hidden" name="time" value="4" /><input type="hidden" name="urlmaskfilter" value=".*" /><input type="hidden" name="prefermaskfilter" value="" /><input type="hidden" name="indexof" value="off" />-->@@ -50,7 +50,6 @@<option #(count-10)#::selected="selected"#(/count-10)#>10</option><option #(count-50)#::selected="selected"#(/count-50)#>50</option><option #(count-100)#::selected="selected"#(/count-100)#>100</option>- <option #(count-1000)#::selected="selected"#(/count-1000)#>1000</option></select></td></tr>@@ -75,11 +74,11 @@<td><select id="time" name="time"><option #(time-1)#::selected="selected"#(/time-1)#>1</option>- <option #(time-3)#::selected="selected"#(/time-3)#>3</option>+ <option #(time-2)#::selected="selected"#(/time-2)#>2</option>+ <option #(time-4)#::selected="selected"#(/time-4)#>4</option><option #(time-6)#::selected="selected"#(/time-6)#>6</option>+ <option #(time-8)#::selected="selected"#(/time-8)#>8</option><option #(time-10)#::selected="selected"#(/time-10)#>10</option>- <option #(time-30)#::selected="selected"#(/time-30)#>30</option>- <option #(time-60)#::selected="selected"#(/time-60)#>60</option></select></td></tr>diff --git a/htroot/index.java b/htroot/index.javaindex 5a54bbe90..ff61f4258 100644--- a/htroot/index.java+++ b/htroot/index.java@@ -66,8 +66,8 @@ public class index {final int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0);final int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0);final String former = (post == null) ? "" : post.get("former", "");- final int count = (post == null) ? 10 : post.getInt("count", 10);- final int time = (post == null) ? 10 : post.getInt("time", 6);+ final int count = Math.min(100, (post == null) ? 10 : post.getInt("count", 10));+ final int time = Math.min(60, (post == null) ? 4 : post.getInt("time", 4));final String urlmaskfilter = (post == null) ? ".*" : post.get("urlmaskfilter", ".*");final String prefermaskfilter = (post == null) ? "" : post.get("prefermaskfilter", "");final String constraint = (post == null) ? plasmaSearchQuery.catchall_constraint.exportB64() : post.get("constraint", "______");@@ -127,17 +127,16 @@ public class index {prop.put("searchoptions_count-10", (count == 10) ? 1 : 0);prop.put("searchoptions_count-50", (count == 50) ? 1 : 0);prop.put("searchoptions_count-100", (count == 100) ? 1 : 0);- prop.put("searchoptions_count-1000", (count == 1000) ? 1 : 0);prop.put("searchoptions_resource-global", ((global) ? 1 : 0));prop.put("searchoptions_resource-global-disabled", (global || clustersearch) ? 0 : 1);prop.put("searchoptions_resource-global-disabled_reason", (indexReceiveGranted) ? 0 : (indexDistributeGranted) ? 1 : 2);prop.put("searchoptions_resource-local", ((global) ? 0 : 1));prop.put("searchoptions_time-1", (time == 1) ? 1 : 0);- prop.put("searchoptions_time-3", (time == 3) ? 1 : 0);+ prop.put("searchoptions_time-2", (time == 2) ? 1 : 0);+ prop.put("searchoptions_time-4", (time == 4) ? 1 : 0);prop.put("searchoptions_time-6", (time == 6) ? 1 : 0);+ prop.put("searchoptions_time-8", (time == 8) ? 1 : 0);prop.put("searchoptions_time-10", (time == 10) ? 1 : 0);- prop.put("searchoptions_time-30", (time == 30) ? 1 : 0);- prop.put("searchoptions_time-60", (time == 60) ? 1 : 0);prop.put("searchoptions_urlmaskoptions", 0);prop.put("searchoptions_urlmaskoptions_urlmaskfilter", urlmaskfilter);prop.put("searchoptions_prefermaskoptions", 0);diff --git a/source/de/anomic/plasma/plasmaCrawlLoader.java b/source/de/anomic/plasma/plasmaCrawlLoader.javaindex eac42b16e..33bf5f78a 100644--- a/source/de/anomic/plasma/plasmaCrawlLoader.java+++ b/source/de/anomic/plasma/plasmaCrawlLoader.java@@ -277,7 +277,9 @@ public final class plasmaCrawlLoader extends Thread {String referer,String initiator,int depth,- plasmaCrawlProfile.entry profile+ plasmaCrawlProfile.entry profile,+ int timeout,+ boolean keepInMemory) {if (!this.crawlwerPool.isClosed) {@@ -293,8 +295,8 @@ public final class plasmaCrawlLoader extends Thread {profile, // crawling profilecrawlingPriority, // crawling priorityfalse, // only download documents whose mimetypes are enabled for the crawler- -1, // use default crawler timeout- false // resource should not be kept in memory+ timeout, // -1 = use default crawler timeout+ keepInMemory // kept in memory ?);// adding the message to the queuediff --git a/source/de/anomic/plasma/plasmaCrawlNURL.java b/source/de/anomic/plasma/plasmaCrawlNURL.javaindex 2728cef68..04a19b9d7 100644--- a/source/de/anomic/plasma/plasmaCrawlNURL.java+++ b/source/de/anomic/plasma/plasmaCrawlNURL.java@@ -191,8 +191,9 @@ public class plasmaCrawlNURL {entry = balancer.pop(minimumDelta, maximumDomAge);if (entry == null) {if (s > balancer.size()) continue;+ int aftersize = balancer.size();balancer.clear(); // the balancer is broken and cannot shrink- throw new IOException("entry is null, balancer cannot shrink; reset of balancer");+ throw new IOException("entry is null, balancer cannot shrink (bevore pop = " + s + ", after pop = " + aftersize + "); reset of balancer");}return entry;}diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex ef76d7b55..ab4e222de 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -2639,7 +2639,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser} catch (IOException e) {refererURL = null;}- cacheLoader.loadAsync(urlEntry.url(), urlEntry.name(), (refererURL!=null)?refererURL.toString():null, urlEntry.initiator(), urlEntry.depth(), profile);+ cacheLoader.loadAsync(urlEntry.url(), urlEntry.name(), (refererURL!=null)?refererURL.toString():null, urlEntry.initiator(), urlEntry.depth(), profile, -1, false);log.logInfo(stats + ": enqueued for load " + urlEntry.url() + " [" + urlEntry.urlhash() + "]");return;}diff --git a/source/de/anomic/ymage/ymageGraph.java b/source/de/anomic/ymage/ymageGraph.javaindex 35f1062f4..87214bf22 100644--- a/source/de/anomic/ymage/ymageGraph.java+++ b/source/de/anomic/ymage/ymageGraph.java@@ -124,11 +124,11 @@ public class ymageGraph {}}- private static final long color_back = ymageMatrix.SUBTRACTIVE_WHITE;+ public static final long color_back = ymageMatrix.SUBTRACTIVE_WHITE;+ public static final long color_text = ymageMatrix.SUBTRACTIVE_BLACK;private static final long color_dot = 0x6633AA;private static final long color_line = 0x333333;private static final long color_lineend = 0x555555;- private static final long color_text = ymageMatrix.SUBTRACTIVE_BLACK;public ymageMatrix draw(int width, int height, int leftborder, int rightborder, int topborder, int bottomborder) {ymageMatrix image = new ymageMatrix(width, height, color_back);