Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- fix for http://www.yacy-forum.de/viewtopic.php?t=3369 - merged netBude's alternative for tables in yacysearch.html & search results valid - added statistic info to index.html as proposed here: http://www.yacy-forum.de/viewtopic.php?p=29762#29762 - fixed error-log in httpTemplate
karlchenofhellb873ad51aba4
diff --git a/htroot/Network.xml b/htroot/Network.xmlindex 1a466c6be..45efbe193 100644--- a/htroot/Network.xml+++ b/htroot/Network.xml@@ -18,9 +18,9 @@<receivedURLs>#[rU]#</receivedURLs><type>#(type)#junior::senior::principal#(/type)#</type><direct>#(type_direct)#direct::passive#(/type_direct)#</direct>- <acceptcrawl>#(acceptcrawl)#0::1#(/acceptcrawl)#</acceptcrawl>- <dhtreceive>#(dhtreceive)#0::1#(/dhtreceive)#</dhtreceive>- <rankingreceive>#(rankingreceive)#0::1#(/rankingreceive)#</rankingreceive>+ <acceptcrawl>#[acceptcrawl]#</acceptcrawl>+ <dhtreceive>#[dhtreceive]#</dhtreceive>+ <rankingreceive>#[rankingreceive]#</rankingreceive><location>#[location]#</location>#(complete)#::@@ -62,8 +62,8 @@<uptime>#[my-uptime]#</uptime><links>#[my-links]#</links><words>#[my-words]#</words>- <acceptcrawl>#(my-acceptcrawl)#0::1#(/my-acceptcrawl)#</acceptcrawl>- <acceptindex>#(my-dhtreceive)#0::1#(/my-dhtreceive)#</acceptindex>+ <acceptcrawl>#[my-acceptcrawl]#</acceptcrawl>+ <acceptindex>#[my-dhtreceive]#</acceptindex><sentwords>#[my-sI]#</sentwords><senturls>#[my-sU]#</senturls><receivedwords>#[my-rI]#</receivedwords>diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.htmlindex 48b44a907..0648fe691 100644--- a/htroot/PerformanceQueues_p.html+++ b/htroot/PerformanceQueues_p.html@@ -51,7 +51,7 @@<td align="right">#[memusepercycle]#</td><td align="right"><input name="#[threadname]#_idlesleep" size="7" maxlength="7" value="#[idlesleep]#" /> milliseconds</td><td align="right"><input name="#[threadname]#_busysleep" size="7" maxlength="7" value="#[busysleep]#" /> milliseconds</td>- <td align="right"><input name="#[threadname]#_memprereq" size="5" maxlength="5" value="#[memprereq]#"#(disabled)#:: disabled="disabled"#(/disabled)# /> kbytes</td>+ <td align="right"><input name="#[threadname]#_memprereq" size="7" maxlength="10" value="#[memprereq]#"#(disabled)#:: disabled="disabled"#(/disabled)# /> kbytes</td><td align="left">#[longdescr]#</td></tr>#{/table}#diff --git a/htroot/Surftips.java b/htroot/Surftips.javaindex 0951c0e09..065e39ca1 100644--- a/htroot/Surftips.java+++ b/htroot/Surftips.java@@ -141,6 +141,7 @@ public class Surftips {prop.put("surftips_results_" + i + "_authorized_recommend", (voted) ? 0 : 1);prop.put("surftips_results_" + i + "_authorized_recommend_negativeVoteLink", "/Surftips.html?voteNegative=" + urlhash + "&refid=" + refid + "&,display=" + display + ((showScore) ? "&score=" : "")); // for negaive votes, we don't send around the bad url again, the hash is enoughprop.put("surftips_results_" + i + "_authorized_recommend_positiveVoteLink", "/Surftips.html?votePositive=" + urlhash + "&refid=" + refid + "&url=" + crypt.simpleEncode(url,null,'b') + "&title=" + crypt.simpleEncode(title,null,'b') + "&description=" + crypt.simpleEncode(description,null,'b') + "&display=" + display + ((showScore) ? "&score=" : ""));+ prop.put("surftips_results_" + i + "_authorized_urlhash", urlhash);prop.put("surftips_results_" + i + "_url", de.anomic.data.wikiCode.replaceHTMLonly(url));prop.put("surftips_results_" + i + "_urlname", nxTools.shortenURLString(url, 60));prop.put("surftips_results_" + i + "_urlhash", urlhash);diff --git a/htroot/env/base.css b/htroot/env/base.cssindex 10b857d90..e37b47b23 100644--- a/htroot/env/base.css+++ b/htroot/env/base.css@@ -164,6 +164,19 @@ form.search table {text-align:left;}+fieldset.yacysearch {+ text-align:left;+ padding-top:10px;+ display:block;+}++div.yacysearch {+ margin-top: .8em;+ display:block;+ position:relative;+ /*left:-60px;*/+}+h2.yacy { /* The heading in index.html */margin:10px auto;text-align:center;diff --git a/htroot/index.html b/htroot/index.htmlindex c1a66dbf6..0fd745a05 100644--- a/htroot/index.html+++ b/htroot/index.html@@ -22,11 +22,11 @@<input name="search" id="search" type="text" size="52" maxlength="80" value="#[former]#" /><input type="submit" name="Enter" value="Search" /><input type="hidden" name="former" value="#[former]#" /><br />- <input type="radio" name="contentdom" value="text" #(contentdomCheckText)#::checked="checked"#(/contentdomCheckText)# />Text - <input type="radio" name="contentdom" value="image" #(contentdomCheckImage)#::checked="checked"#(/contentdomCheckImage)# />Images - <input type="radio" name="contentdom" value="audio" #(contentdomCheckAudio)#::checked="checked"#(/contentdomCheckAudio)# />Audio - <input type="radio" name="contentdom" value="video" #(contentdomCheckVideo)#::checked="checked"#(/contentdomCheckVideo)# />Video - <input type="radio" name="contentdom" value="app" #(contentdomCheckApp)#::checked="checked"#(/contentdomCheckApp)# />Applications + <input type="radio" id="text" name="contentdom" value="text" #(contentdomCheckText)#::checked="checked"#(/contentdomCheckText)# /><label for="text">Text</label> + <input type="radio" id="image" name="contentdom" value="image" #(contentdomCheckImage)#::checked="checked"#(/contentdomCheckImage)# /><label for="image">Images</label> + <input type="radio" id="audio" name="contentdom" value="audio" #(contentdomCheckAudio)#::checked="checked"#(/contentdomCheckAudio)# /><label for="audio">Audio</label> + <input type="radio" id="video" name="contentdom" value="video" #(contentdomCheckVideo)#::checked="checked"#(/contentdomCheckVideo)# /><label for="video">Video</label> + <input type="radio" id="app" name="contentdom" value="app" #(contentdomCheckApp)#::checked="checked"#(/contentdomCheckApp)# /><label for="app">Applications</label> #(searchoptions)#<input type="hidden" name="count" value="10" /><input type="hidden" name="resource" value="global" />@@ -101,11 +101,12 @@Constraints:</td><td>- <input type="checkbox" name="indexof" #[indexofChecked]# /> only index pages+ <input type="checkbox" id="indexof" name="indexof" #[indexofChecked]# /> <label for="indexof">only index pages</label></td></tr></table>#(/searchoptions)#+ <p>This peer holds #[links]# URLs of #[total-links]# in the known network.</p></form>#(display)#diff --git a/htroot/index.java b/htroot/index.javaindex 774620fe7..58ea9d415 100644--- a/htroot/index.java+++ b/htroot/index.java@@ -40,6 +40,8 @@ import de.anomic.server.serverCore;import de.anomic.server.serverDate;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;+import de.anomic.yacy.yacyCore;+import de.anomic.yacy.yacySeed;public class index {@@ -91,6 +93,11 @@ public class index {if (cds.equals("image")) contentdom = plasmaSearchQuery.CONTENTDOM_IMAGE;if (cds.equals("app")) contentdom = plasmaSearchQuery.CONTENTDOM_APP;+ try {+ prop.put("links", groupDigits(Long.parseLong(yacyCore.seedDB.mySeed.get(yacySeed.LCOUNT, "0"))));+ } catch (NumberFormatException e) { prop.put("links", "0"); }+ prop.put("total-links", groupDigits(yacyCore.seedDB.countActiveURL()));+// we create empty entries for template stringsString promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", "");if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P WEB SEARCH";@@ -133,5 +140,11 @@ public class index {return prop;}-++ private static String groupDigits(long Number) {+ final String s = Long.toString(Number);+ String t = "";+ for (int i = 0; i < s.length(); i++) t = s.charAt(s.length() - i - 1) + (((i % 3) == 0) ? "." : "") + t;+ return t.substring(0, t.length() - 1);+ }}diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.jsindex 48d05c736..ef5487a5f 100644--- a/htroot/js/yacysearch.js+++ b/htroot/js/yacysearch.js@@ -4,7 +4,7 @@ function AllTextSnippets() {var span = document.getElementsByTagName("span");for(var x=0;x<span.length;x++) {if (span[x].className == 'snippetLoading') {- var url = document.getElementById("url" + span[x].id);+ var url = document.getElementById("url" + span[x].id.substring(1));requestTextSnippet(url,query);}}@@ -66,7 +66,7 @@ function handleTextState(req) {var urlHash = response.getElementsByTagName("urlHash")[0].firstChild.data;var status = response.getElementsByTagName("status")[0].firstChild.data;- var span = document.getElementById(urlHash)+ var span = document.getElementById("h" + urlHash)removeAllChildren(span);//span.removeChild(span.firstChild);diff --git a/htroot/yacysearch.html b/htroot/yacysearch.htmlindex 6cf96ec17..4d510ac3b 100644--- a/htroot/yacysearch.html+++ b/htroot/yacysearch.html@@ -21,19 +21,12 @@<form class="search small" action="yacysearch.html" method="get"><p class="yacylogo"><a href="http://yacy.net/yacy/" class="yacylogo"><img src="/env/grafics/yacy.png" alt="yacy" /></a></p><h2>#[promoteSearchPageGreeting]#</h2>- <fieldset class="maininput">- <table width="100%" border="0" cellspacing="0" cellpadding="0">- <tr>- <td>+ <div>+ <fieldset class="yacys"><input id="search" name="search" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />- <input id="Enter" type="submit" name="Enter" value="Search" />- </td>- <td>+ <input id="Enter" type="submit" name="Enter" value="Search" /> <a href="index.html?display=#[display]#&searchoptions=1&count=#[count]#&order=#[order]#&resource=#[resource]#&time=#[time]#&urlmaskfilter=#[urlmaskfilter]#&prefermaskfilter=#[prefermaskfilter]#&cat=#[cat]#&type=#[type]#&constraint=#[constraint]#&contentdom=#[contentdom]#&former=#[former]#">more options</a>- </td>- </tr>- <tr>- <td colspan="2">+ <div class="yacysearch"><input type="radio" id="text" name="contentdom" value="text"#(contentdomCheckText)#:: checked="checked"#(/contentdomCheckText)# /><label for="text">Text</label> <input type="radio" id="images" name="contentdom" value="image"#(contentdomCheckImage)#:: checked="checked"#(/contentdomCheckImage)# />@@ -44,9 +37,7 @@<label for="video">Video</label> <input type="radio" id="appl" name="contentdom" value="app"#(contentdomCheckApp)#:: checked="checked"#(/contentdomCheckApp)# /><label for="appl">Applications</label>- </td>- </tr>- </table>+ </div><input type="hidden" name="former" value="#[former]#" /><input type="hidden" name="count" value="#[count]#" /><input type="hidden" name="order" value="#[order]#" />@@ -60,6 +51,7 @@<input type="hidden" name="display" value="#[display]#" /><input type="hidden" name="constraint" value="#[constraint]#" /></fieldset>+ </div></form><script type="text/javascript">@@ -129,7 +121,7 @@ document.getElementById("Enter").value = "search again - catch up more links";</div>#(/authorized)#<h4 class="linktitle"><a href="#[url]#">#[description]#</a></h4>- <p class="snippet"><span class="#(snippet)#snippetLoading::snippetLoaded#(/snippet)#" id="#[urlhash]#">#(snippet)#loading snippet ...::#[text]##(/snippet)#</span></p>+ <p class="snippet"><span class="#(snippet)#snippetLoading::snippetLoaded#(/snippet)#" id="h#[urlhash]#">#(snippet)#loading snippet ...::#[text]##(/snippet)#</span></p><p class="url"><a href="#[url]#" id="url#[urlhash]#">#[urlname]#</a></p><p class="urlinfo">#[date]# | YBR-#[ybr]# | <a href="ViewFile.html?urlHash=#[urlhash]#&words=#[words]#">Info</a> | <a href="yacysearch.html?cat=image&url=#[url]#&search=#[former]#">Pictures</a></p></div>@@ -142,27 +134,28 @@ document.getElementById("Enter").value = "search again - catch up more links";</script><!-- linklist end -->- <p>#(resultbottomline)#::- The global search resulted in #[globalresults]# link contributions from other YaCy peers.+ <p>The global search resulted in #[globalresults]# link contributions from other YaCy peers.</p>::- You can enrich the search results by using the 'global' option: This will search also other YaCy peers+ <p>You can enrich the search results by using the 'global' option: This will search also other YaCy peers</p>::- You cannot get global search results because you are not connected to another YaCy peer.- To connect you must first use the proxy.- See here for an <a href="http://www.anomic.de/AnomicHTTPProxy/Installation.html#wininst">installation guide</a>.- Alternatively, you can run the proxy in permanent online mode, which also grants global search.- To do this, press this button:</p>+ <p>+ You cannot get global search results because you are not connected to another YaCy peer.+ To connect you must first use the proxy.+ See here for an <a href="http://www.anomic.de/AnomicHTTPProxy/Installation.html#wininst">installation guide</a>.+ Alternatively, you can run the proxy in permanent online mode, which also grants global search.+ To do this, press this button:+ </p><form action="SettingsAck_p.html" method="get">- <input type="submit" name="pmode" value="go online">+ <input type="submit" name="pmode" value="go online"></form>- <p>::- You can enrich the search results by using the 'global' option; you must also switch to online mode- (by using the proxy) to contribute to the global index.- #(/resultbottomline)#+ <p>+ You can enrich the search results by using the 'global' option; you must also switch to online mode+ (by using the proxy) to contribute to the global index.</p>+ #(/resultbottomline)#::<!-- type 1: media search --><!-- linklist begin -->#{results}#diff --git a/source/de/anomic/http/httpTemplate.java b/source/de/anomic/http/httpTemplate.javaindex 702ff0374..566a8cfaf 100644--- a/source/de/anomic/http/httpTemplate.java+++ b/source/de/anomic/http/httpTemplate.java@@ -466,9 +466,9 @@ public final class httpTemplate {}}catch(IOException e){//file not found?- serverLog.logSevere("FILEHANDLER","Include Error with file: "+filename);+ serverLog.logSevere("FILEHANDLER","Include Error with file: " + new String(filename, "UTF-8"));} finally {- if (br!=null) try{br.close(); br=null;}catch(Exception e){}+ if (br != null) try { br.close(); br=null; } catch (Exception e) {}}PushbackInputStream pis2 = new PushbackInputStream(new ByteArrayInputStream(include.getBytes()));structure.append("<fileinclude file=\"".getBytes("UTF-8")).append(filename).append(">\n".getBytes("UTF-8"));diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.javaindex 6df1f852b..7c4f26b1c 100644--- a/source/de/anomic/plasma/plasmaSwitchboard.java+++ b/source/de/anomic/plasma/plasmaSwitchboard.java@@ -2179,8 +2179,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser// suppress line: there is no match in that resource} else {*/prop.put("type_results_" + i + "_authorized_recommend", (yacyCore.newsPool.getSpecific(yacyNewsPool.OUTGOING_DB, "stippadd", "url", urlstring) == null) ? 1 : 0);- prop.put("type_results_" + i + "_authorized_recommend_deletelink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*");- prop.put("type_results_" + i + "_authorized_recommend_recommendlink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*");+ prop.put("type_results_" + i + "_authorized_recommend_deletelink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*");+ prop.put("type_results_" + i + "_authorized_recommend_recommendlink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*");+ prop.put("type_results_" + i + "_authorized_urlhash", urlhash);prop.put("type_results_" + i + "_description", comp.descr());prop.put("type_results_" + i + "_url", urlstring);prop.put("type_results_" + i + "_urlhash", urlhash);