Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added new buttons to search result page in p2p mode which show the switch between p2p search and the 'stealth mode' which is simply a non-p2p search within the p2p network. The functionality was there all the time, but the switch to this was not very visible.
Michael Peter Christen5132bf719c95
diff --git a/htroot/env/base.css b/htroot/env/base.cssindex cda1fcb29..4fde7cd73 100644--- a/htroot/env/base.css+++ b/htroot/env/base.css@@ -947,12 +947,6 @@ div#api {z-index: 100;}-div#yacylivesearch {- float:right;- margin-right: 90px;- margin-top: -27px;-}-div#api span {display: none;}@@ -961,9 +955,9 @@ div#api:hover span {display: block;position: absolute;font-size:1em;- top: 40px;- left: -170px; /* 30 - width */- width: 200px;+ top: 48px;+ left: -200px; /* 30 - width */+ width: 160px;padding: 3px;color: #000000;background: #DDDDDD;@@ -971,6 +965,39 @@ div#api:hover span {border: 1px dashed black;z-index: 100;}++div#searchmode {+ position:absolute;+ top:51px;+ right:20px;+ z-index: 100;+}++div#searchmode span {+ display: none;+}++div#searchmode:hover span {+ display: block;+ position: absolute;+ font-size:1em;+ top: 1px;+ left: -169px; /* 30 - width */+ width: 160px;+ padding: 3px;+ color: #000000;+ background: #DDDDDD;+ text-align: center;+ border: 1px dashed black;+ z-index: 100;+ }++div#yacylivesearch {+ float:right;+ margin-right: 90px;+ margin-top: -27px;+}+div#info {float:left;diff --git a/htroot/env/grafics/searchmode_p2p_activated_32.png b/htroot/env/grafics/searchmode_p2p_activated_32.pngnew file mode 100644index 000000000..c4adcb6ddBinary files /dev/null and b/htroot/env/grafics/searchmode_p2p_activated_32.png differdiff --git a/htroot/env/grafics/searchmode_p2p_deactivated_32.png b/htroot/env/grafics/searchmode_p2p_deactivated_32.pngnew file mode 100644index 000000000..f5ee00f16Binary files /dev/null and b/htroot/env/grafics/searchmode_p2p_deactivated_32.png differdiff --git a/htroot/env/grafics/searchmode_stealth_activated_32.png b/htroot/env/grafics/searchmode_stealth_activated_32.pngnew file mode 100644index 000000000..6778ad2deBinary files /dev/null and b/htroot/env/grafics/searchmode_stealth_activated_32.png differdiff --git a/htroot/env/grafics/searchmode_stealth_deactivated_32.png b/htroot/env/grafics/searchmode_stealth_deactivated_32.pngnew file mode 100644index 000000000..f80a13d0aBinary files /dev/null and b/htroot/env/grafics/searchmode_stealth_deactivated_32.png differdiff --git a/htroot/index.html b/htroot/index.htmlindex 3d2152dc5..a37d6b3de 100644--- a/htroot/index.html+++ b/htroot/index.html@@ -91,8 +91,13 @@#(resource-select)#::<td><label for="resource">Resource</label>:</td><td>- <input type="radio" name="resource" id="rglobal" value="global" #(global)#::checked="checked"#(/global)# #(global-disabled)#::disabled="disabled"#(/global-disabled)#/><label for="rglobal">the peer-to-peer network</label>- <input type="radio" name="resource" id="rlocal" value="local" #(local)#::checked="checked"#(/local)#/><label for="rlocal">only the local index</label>+ <input type="radio" name="resource" id="rglobal" value="global" checked="checked" /><label for="rglobal">the peer-to-peer network</label>+ <input type="radio" name="resource" id="rlocal" value="local"><label for="rlocal">only the local index</label>+ </td>::+ <td><label for="resource">Resource</label>:</td>+ <td>+ <input type="radio" name="resource" id="rglobal" value="global"/><label for="rglobal">the peer-to-peer network</label>+ <input type="radio" name="resource" id="rlocal" value="local" checked="checked"/><label for="rlocal">only the local index</label></td>#(/resource-select)#</tr>diff --git a/htroot/index.java b/htroot/index.javaindex 91fba2208..672a1da43 100644--- a/htroot/index.java+++ b/htroot/index.java@@ -102,10 +102,7 @@ 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_resource-select", (sb.peers == null || sb.peers.sizeConnected() == 0 || !global) ? 0 : 1);- prop.put("searchoptions_resource-select_global", global ? "1" : "0");- prop.put("searchoptions_resource-select_global-disabled", indexReceiveGranted ? "0" : "1");- prop.put("searchoptions_resource-select_local", global ? "0" : "1");+ prop.put("searchoptions_resource-select", (sb.peers == null || sb.peers.sizeConnected() == 0 || !indexReceiveGranted) ? 0 : global ? 1 : 2);prop.put("searchoptions_prefermaskoptions", "0");prop.putHTML("searchoptions_prefermaskoptions_prefermaskfilter", prefermaskfilter);prop.put("searchoptions_indexofChecked", "");diff --git a/htroot/yacysearch.html b/htroot/yacysearch.htmlindex 842b0e4ff..ba393dc8b 100644--- a/htroot/yacysearch.html+++ b/htroot/yacysearch.html@@ -76,7 +76,18 @@ document.write("\<a href=\"yacysearch.rss?" + window.location.search.substring(1The query format is similar to <a href="http://www.loc.gov/standards/sru/">SRU</a>.Click the API icon to see an example call to the search rss API.To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span>-</div>+</div>+#(resource-select)#::+<div id="searchmode">+<a href="yacysearch.html?resource=local"><img src="env/grafics/searchmode_p2p_activated_32.png" width="91" height="32"/></a><br/>+<a href="yacysearch.html?resource=local"><img src="env/grafics/searchmode_stealth_deactivated_32.png" width="91" height="32"/></a>+<span>Your search is done using peers in the YaCy P2P network. You can switch to 'Stealth Mode' which will cause that your search is only done in your own peer, giving you full privacy.</span>+</div>::+<div id="searchmode">+<a href="yacysearch.html?resource=global"><img src="env/grafics/searchmode_p2p_deactivated_32.png" width="91" height="32"/></a><br/>+<a href="yacysearch.html?resource=global"><img src="env/grafics/searchmode_stealth_activated_32.png" width="91" height="32"/></a>+<span>Your search is done using only your own peer, locally. You can switch to 'Peer-to-Peer Mode' which will cause that your search is done using the other peers in the YaCy network.</span>+</div>#(/resource-select)##%env/templates/simpleheader.template%##(/topmenu)#<script type="text/javascript">diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex f984bc4ba..e999d739a 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -153,6 +153,13 @@ public class yacysearch {prop.put("searchBaseURL", "http://" + hostName + "/yacysearch.html");prop.put("rssYacyImageURL", "http://" + hostName + "/env/grafics/yacy.gif");prop.put("thisaddress", hostName);+ final boolean clustersearch = sb.isRobinsonMode() && sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "").equals(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER);+ final boolean indexReceiveGranted =+ sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true)+ || sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true)+ || clustersearch;+ boolean global = post == null || (post.get("resource", "local").equals("global") && sb.peers.sizeConnected() > 0 && indexReceiveGranted);+ prop.put("topmenu_resource-select", (sb.peers == null || sb.peers.sizeConnected() == 0 || !indexReceiveGranted) ? 0 : global ? 1 : 2);if ( post == null || indexSegment == null || env == null || !searchAllowed ) {// we create empty entries for template strings@@ -222,7 +229,6 @@ public class yacysearch {post.getInt("maximumRecords", post.getInt("count", post.getInt("rows", 10)))); // SRU syntax with old property as alternativeint startRecord = post.getInt("startRecord", post.getInt("offset", post.getInt("start", 0)));- boolean global = post.get("resource", "local").equals("global") && sb.peers.sizeConnected() > 0;final boolean indexof = (post != null && post.get("indexof", "").equals("on"));String prefermask = (post == null) ? "" : post.get("prefermaskfilter", "");@@ -240,12 +246,6 @@ public class yacysearch {}// SEARCH- final boolean clustersearch = sb.isRobinsonMode() && sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "").equals(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER);- final boolean indexReceiveGranted =- sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true)- || sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true)- || clustersearch;- global = global && indexReceiveGranted; // if the user does not want indexes from remote peers, it cannot be a global searchnnfinal boolean intranetMode = sb.isIntranetMode() || sb.isAllIPMode();// increase search statistic counter