added option to Config_Network_p.html to enable remote search while

DHT-Receive is switched off.
pull/1/head
Michael Peter Christen 11 years ago
parent 1a4a69c226
commit 087df05e24

@ -478,6 +478,7 @@ allowDistributeIndex=true
allowDistributeIndexWhileCrawling=false allowDistributeIndexWhileCrawling=false
allowDistributeIndexWhileIndexing=true allowDistributeIndexWhileIndexing=true
allowReceiveIndex=true allowReceiveIndex=true
allowReceiveIndex.search=true
allowUnlimitedReceiveIndexFrom= allowUnlimitedReceiveIndexFrom=
indexReceiveBlockBlacklist=true indexReceiveBlockBlacklist=true

@ -180,6 +180,7 @@ public class ConfigBasic {
// switch to p2p mode // switch to p2p mode
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, true); sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, true);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true); sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, true);
// set default behavior for search verification // set default behavior for search verification
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh"); // nocache,iffresh,ifexist,cacheonly,false sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh"); // nocache,iffresh,ifexist,cacheonly,false
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true"); sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true");
@ -190,6 +191,7 @@ public class ConfigBasic {
// switch to robinson mode // switch to robinson mode
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, false); sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, false);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false); sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, false);
// set default behavior for search verification // set default behavior for search verification
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "ifexist"); // nocache,iffresh,ifexist,cacheonly,false sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "ifexist"); // nocache,iffresh,ifexist,cacheonly,false
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "false"); sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "false");
@ -200,6 +202,7 @@ public class ConfigBasic {
// switch to p2p mode: enable ad-hoc networks between intranet users // switch to p2p mode: enable ad-hoc networks between intranet users
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, false); sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, false);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false); sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, false);
// set default behavior for search verification // set default behavior for search verification
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "cacheonly"); // nocache,iffresh,ifexist,cacheonly,false sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "cacheonly"); // nocache,iffresh,ifexist,cacheonly,false
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "false"); sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "false");

@ -11,17 +11,18 @@
if(!(dist || recv)) { if(!(dist || recv)) {
//robinson-mode //robinson-mode
document.getElementById("ConfigForm").network[1].checked = true; document.getElementById("ConfigForm").network[1].checked = true;
} } else {
else {
//p2p-mode //p2p-mode
document.getElementById("ConfigForm").network[0].checked = true; document.getElementById("ConfigForm").network[0].checked = true;
} }
document.getElementById("ConfigForm").indexReceiveSearch[recv ? 0 : 1].checked = true;
} }
function EnableRobinson() { function EnableRobinson() {
if(document.getElementById("ConfigForm").network[1].checked) { if(document.getElementById("ConfigForm").network[1].checked) {
document.getElementById("ConfigForm").indexDistribute.checked = false; document.getElementById("ConfigForm").indexDistribute.checked = false;
document.getElementById("ConfigForm").indexReceive.checked = false; document.getElementById("ConfigForm").indexReceive.checked = false;
document.getElementById("ConfigForm").indexReceiveSearch[1].checked = true;
} }
} }
@ -29,7 +30,7 @@
if(document.getElementById("ConfigForm").network[0].checked) { if(document.getElementById("ConfigForm").network[0].checked) {
document.getElementById("ConfigForm").indexDistribute.checked = true; document.getElementById("ConfigForm").indexDistribute.checked = true;
document.getElementById("ConfigForm").indexReceive.checked = true; document.getElementById("ConfigForm").indexReceive.checked = true;
document.getElementById("ConfigForm").crawlResponse.checked = true; document.getElementById("ConfigForm").indexReceiveSearch[0].checked = true;
} }
} }
//--> //-->
@ -143,7 +144,15 @@
<input type="radio" value="off" id="indexReceiveBlockBlacklistOff" <input type="radio" value="off" id="indexReceiveBlockBlacklistOff"
name="indexReceiveBlockBlacklist" name="indexReceiveBlockBlacklist"
#(indexReceiveBlockBlacklistChecked.off)#::checked="checked" #(/indexReceiveBlockBlacklistChecked.off)#/> #(indexReceiveBlockBlacklistChecked.off)#::checked="checked" #(/indexReceiveBlockBlacklistChecked.off)#/>
<label for="indexReceiveBlockBlacklistOff">accept transmitted URLs that match your blacklist</label>. <label for="indexReceiveBlockBlacklistOff">accept transmitted URLs that match your blacklist</label>.<br />
<input type="radio" value="on" id="indexReceiveSearchOn"
name="indexReceiveSearch"
#(indexReceiveSearchChecked)#::checked="checked"#(/indexReceiveSearchChecked)#/>
<label for="indexReceiveSearchOn">allow</label> /
<input type="radio" value="off" id="indexReceiveSearchOff"
name="indexReceiveSearch"
#(indexReceiveSearchChecked)#checked="checked"::#(/indexReceiveSearchChecked)#/>
<label for="indexReceiveSearchOff">deny remote search</label>.
</dd> </dd>
<dt></dt> <dt></dt>
<dd> <dd>

@ -89,6 +89,7 @@ public class ConfigNetwork_p
// DHT control // DHT control
boolean indexDistribute = "on".equals(post.get("indexDistribute", "")); boolean indexDistribute = "on".equals(post.get("indexDistribute", ""));
boolean indexReceive = "on".equals(post.get("indexReceive", "")); boolean indexReceive = "on".equals(post.get("indexReceive", ""));
boolean indexReceiveSearch = "on".equals(post.get("indexReceiveSearch", ""));
if ( !indexReceive ) { if ( !indexReceive ) {
// remove heuristics // remove heuristics
sb.setConfig(SwitchboardConstants.HEURISTIC_SITE, false); sb.setConfig(SwitchboardConstants.HEURISTIC_SITE, false);
@ -114,47 +115,21 @@ public class ConfigNetwork_p
} }
} }
if ( indexDistribute ) { sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, indexDistribute);
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, true); sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_CRAWLING, "on".equals(post.get("indexDistributeWhileCrawling", "")));
} else { sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_INDEXING, "on".equals(post.get("indexDistributeWhileIndexing", "")));
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW, false); sb.peers.mySeed().setFlagAcceptRemoteIndex(indexReceive);
} sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, indexReceive);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, indexReceiveSearch);
if ( "on".equals(post.get("indexDistributeWhileCrawling", "")) ) { sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, false);
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_CRAWLING, true);
} else {
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_CRAWLING, false);
}
if ( "on".equals(post.get("indexDistributeWhileIndexing", "")) ) {
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_INDEXING, true);
} else {
sb.setConfig(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_INDEXING, false);
}
if ( indexReceive ) { sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_BLOCK_BLACKLIST, "on".equals(post.get("indexReceiveBlockBlacklist", "")));
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true);
sb.peers.mySeed().setFlagAcceptRemoteIndex(true);
} else {
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false);
sb.peers.mySeed().setFlagAcceptRemoteIndex(false);
sb.setConfig(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, false);
}
if ( "on".equals(post.get("indexReceiveBlockBlacklist", "")) ) {
sb.setConfig("indexReceiveBlockBlacklist", true);
} else {
sb.setConfig("indexReceiveBlockBlacklist", false);
}
if ( post.containsKey("peertags") ) { if (post.containsKey("peertags")) {
sb.peers.mySeed().setPeerTags( sb.peers.mySeed().setPeerTags(MapTools.string2set(normalizedList(post.get("peertags")), ","));
MapTools.string2set(normalizedList(post.get("peertags")), ","));
} }
sb.setConfig("cluster.mode", post.get( sb.setConfig("cluster.mode", post.get(SwitchboardConstants.CLUSTER_MODE, SwitchboardConstants.CLUSTER_MODE_PUBLIC_PEER));
SwitchboardConstants.CLUSTER_MODE,
SwitchboardConstants.CLUSTER_MODE_PUBLIC_PEER));
sb.setConfig("cluster.peers.ipport", checkIPPortList(post.get("cluster.peers.ipport", ""))); sb.setConfig("cluster.peers.ipport", checkIPPortList(post.get("cluster.peers.ipport", "")));
sb.setConfig( sb.setConfig(
"cluster.peers.yacydomain", "cluster.peers.yacydomain",
@ -176,37 +151,28 @@ public class ConfigNetwork_p
final int RTCppm = (int) (60000L / RTCbusySleep); final int RTCppm = (int) (60000L / RTCbusySleep);
prop.put("acceptCrawlLimit", RTCppm); prop.put("acceptCrawlLimit", RTCppm);
prop.put("indexDistributeWhileCrawling.on", sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_CRAWLING, true));
prop.put("indexDistributeWhileCrawling.off", !sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_CRAWLING, true));
prop.put("indexDistributeWhileIndexing.on", sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_INDEXING, true));
prop.put("indexDistributeWhileIndexing.off", !sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_INDEXING, true));
prop.put("indexReceiveBlockBlacklistChecked.on", sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_BLOCK_BLACKLIST, true));
prop.put("indexReceiveBlockBlacklistChecked.off", !sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_BLOCK_BLACKLIST, true));
prop.putHTML("peertags", MapTools.set2string(sb.peers.mySeed().getPeerTags(), ",", false));
final boolean indexDistribute = sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, true); final boolean indexDistribute = sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, true);
final boolean indexReceive = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true); final boolean indexReceive = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true);
prop.put("indexDistributeChecked", (indexDistribute) ? "1" : "0"); final boolean indexReceiveSearch = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, true);
prop.put( prop.put("indexDistributeChecked", indexDistribute);
"indexDistributeWhileCrawling.on", prop.put("indexReceiveChecked", indexReceive);
(sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_CRAWLING, true)) ? "1" : "0"); prop.put("indexReceiveSearchChecked", indexReceiveSearch);
prop.put(
"indexDistributeWhileCrawling.off",
(sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_CRAWLING, true)) ? "0" : "1");
prop.put(
"indexDistributeWhileIndexing.on",
(sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_INDEXING, true)) ? "1" : "0");
prop.put(
"indexDistributeWhileIndexing.off",
(sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW_WHILE_INDEXING, true)) ? "0" : "1");
prop.put("indexReceiveChecked", (indexReceive) ? "1" : "0");
prop.put(
"indexReceiveBlockBlacklistChecked.on",
(sb.getConfigBool("indexReceiveBlockBlacklist", true)) ? "1" : "0");
prop.put(
"indexReceiveBlockBlacklistChecked.off",
(sb.getConfigBool("indexReceiveBlockBlacklist", true)) ? "0" : "1");
prop.putHTML("peertags", MapTools.set2string(sb.peers.mySeed().getPeerTags(), ",", false));
// set seed information directly // set seed information directly
sb.peers.mySeed().setFlagAcceptRemoteCrawl(sb.getConfigBool("crawlResponse", false)); sb.peers.mySeed().setFlagAcceptRemoteCrawl(sb.getConfigBool("crawlResponse", false));
sb.peers.mySeed().setFlagAcceptRemoteIndex(indexReceive); sb.peers.mySeed().setFlagAcceptRemoteIndex(indexReceive);
// set p2p/robinson mode flags and values // set p2p/robinson mode flags and values
prop.put("p2p.checked", (indexDistribute || indexReceive) ? "1" : "0"); prop.put("p2p.checked", indexDistribute || indexReceive);
prop.put("robinson.checked", (indexDistribute || indexReceive) ? "0" : "1"); prop.put("robinson.checked", !(indexDistribute || indexReceive));
prop.putHTML("cluster.peers.ipport", sb.getConfig("cluster.peers.ipport", "")); prop.putHTML("cluster.peers.ipport", sb.getConfig("cluster.peers.ipport", ""));
prop.putHTML("cluster.peers.yacydomain", sb.getConfig("cluster.peers.yacydomain", "")); prop.putHTML("cluster.peers.yacydomain", sb.getConfig("cluster.peers.yacydomain", ""));
StringBuilder hashes = new StringBuilder(); StringBuilder hashes = new StringBuilder();
@ -220,15 +186,9 @@ public class ConfigNetwork_p
prop.put("cluster.peers.yacydomain.hashes", hashes.toString()); prop.put("cluster.peers.yacydomain.hashes", hashes.toString());
// set p2p mode flags // set p2p mode flags
prop.put( prop.put("privatepeerChecked", SwitchboardConstants.CLUSTER_MODE_PRIVATE_PEER.equals(sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "")));
"privatepeerChecked", prop.put("publicclusterChecked", SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER.equals(sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "")));
(SwitchboardConstants.CLUSTER_MODE_PRIVATE_PEER.equals(sb.getConfig(SwitchboardConstants.CLUSTER_MODE, ""))) ? "1" : "0"); prop.put("publicpeerChecked", SwitchboardConstants.CLUSTER_MODE_PUBLIC_PEER.equals(sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "")));
prop.put(
"publicclusterChecked",
(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER.equals(sb.getConfig(SwitchboardConstants.CLUSTER_MODE, ""))) ? "1" : "0");
prop.put(
"publicpeerChecked",
(SwitchboardConstants.CLUSTER_MODE_PUBLIC_PEER.equals(sb.getConfig(SwitchboardConstants.CLUSTER_MODE, ""))) ? "1" : "0");
// set network configuration // set network configuration
prop.putHTML("network.unit.definition", sb.getConfig("network.unit.definition", "")); prop.putHTML("network.unit.definition", sb.getConfig("network.unit.definition", ""));

@ -73,8 +73,7 @@ public class index {
final int type = (post == null) ? 0 : post.getInt("type", 0); final int type = (post == null) ? 0 : post.getInt("type", 0);
//final boolean indexDistributeGranted = sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, true); //final boolean indexDistributeGranted = sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, true);
final boolean indexReceiveGranted = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true) || final boolean indexReceiveGranted = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, true);
sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true);
global = global && indexReceiveGranted; global = global && indexReceiveGranted;
// search domain // search domain

@ -96,7 +96,7 @@ public final class transferRWI {
final int entryc = post.getInt("entryc", 0); // number of entries in indexes final int entryc = post.getInt("entryc", 0); // number of entries in indexes
byte[] indexes = post.get("indexes", "").getBytes(); // the indexes, as list of word entries byte[] indexes = post.get("indexes", "").getBytes(); // the indexes, as list of word entries
boolean granted = sb.getConfigBool("allowReceiveIndex", false); boolean granted = sb.getConfigBool("allowReceiveIndex", false);
final boolean blockBlacklist = sb.getConfigBool("indexReceiveBlockBlacklist", false); final boolean blockBlacklist = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_BLOCK_BLACKLIST, false);
final long cachelimit = sb.getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 100000); final long cachelimit = sb.getConfigLong(SwitchboardConstants.WORDCACHE_MAX_COUNT, 100000);
final Seed otherPeer = sb.peers.get(iam); final Seed otherPeer = sb.peers.get(iam);
final String otherPeerName = iam + ":" + ((otherPeer == null) ? "NULL" : (otherPeer.getName() + "/" + otherPeer.getVersion())); final String otherPeerName = iam + ":" + ((otherPeer == null) ? "NULL" : (otherPeer.getName() + "/" + otherPeer.getVersion()));

@ -46,6 +46,7 @@ import net.yacy.peers.Protocol;
import net.yacy.peers.Seed; import net.yacy.peers.Seed;
import net.yacy.repository.Blacklist.BlacklistType; import net.yacy.repository.Blacklist.BlacklistType;
import net.yacy.search.Switchboard; import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
import net.yacy.server.serverCore; import net.yacy.server.serverCore;
import net.yacy.server.serverObjects; import net.yacy.server.serverObjects;
import net.yacy.server.serverSwitch; import net.yacy.server.serverSwitch;
@ -69,7 +70,7 @@ public final class transferURL {
// final String key = post.get("key", ""); // transmission key // final String key = post.get("key", ""); // transmission key
final int urlc = post.getInt("urlc", 0); // number of transported urls final int urlc = post.getInt("urlc", 0); // number of transported urls
final boolean granted = sb.getConfigBool("allowReceiveIndex", false); final boolean granted = sb.getConfigBool("allowReceiveIndex", false);
final boolean blockBlacklist = sb.getConfigBool("indexReceiveBlockBlacklist", false); final boolean blockBlacklist = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_BLOCK_BLACKLIST, false);
// response values // response values
String result = ""; String result = "";

@ -153,10 +153,7 @@ public class yacysearch {
prop.put("rssYacyImageURL", "http://" + hostName + "/env/grafics/yacy.gif"); prop.put("rssYacyImageURL", "http://" + hostName + "/env/grafics/yacy.gif");
prop.put("thisaddress", hostName); prop.put("thisaddress", hostName);
final boolean clustersearch = sb.isRobinsonMode() && sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "").equals(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER); final boolean clustersearch = sb.isRobinsonMode() && sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "").equals(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER);
final boolean indexReceiveGranted = final boolean indexReceiveGranted = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, true) || clustersearch;
sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true)
|| sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true)
|| clustersearch;
boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted; boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted;
boolean global = post == null || (post.get("resource", "local").equals("global") && p2pmode); boolean global = post == null || (post.get("resource", "local").equals("global") && p2pmode);
boolean stealthmode = p2pmode && !global; boolean stealthmode = p2pmode && !global;

@ -260,10 +260,7 @@ public class yacysearchitem {
prop.put("content_loc_lon", result.lon()); prop.put("content_loc_lon", result.lon());
} }
final boolean clustersearch = sb.isRobinsonMode() && sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "").equals(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER); final boolean clustersearch = sb.isRobinsonMode() && sb.getConfig(SwitchboardConstants.CLUSTER_MODE, "").equals(SwitchboardConstants.CLUSTER_MODE_PUBLIC_CLUSTER);
final boolean indexReceiveGranted = final boolean indexReceiveGranted = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, true) || clustersearch;
sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true)
|| sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true)
|| clustersearch;
boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted; boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted;
boolean stealthmode = p2pmode && theSearch.query.isLocal(); boolean stealthmode = p2pmode && theSearch.query.isLocal();
if ((sb.getConfigBool(SwitchboardConstants.HEURISTIC_SEARCHRESULTS, false) || if ((sb.getConfigBool(SwitchboardConstants.HEURISTIC_SEARCHRESULTS, false) ||

@ -243,6 +243,9 @@ public final class SwitchboardConstants {
*/ */
public static final String INDEX_DIST_ALLOW = "allowDistributeIndex"; public static final String INDEX_DIST_ALLOW = "allowDistributeIndex";
public static final String INDEX_RECEIVE_ALLOW = "allowReceiveIndex"; public static final String INDEX_RECEIVE_ALLOW = "allowReceiveIndex";
public static final String INDEX_RECEIVE_ALLOW_SEARCH = "allowReceiveIndex.search";
public static final String INDEX_RECEIVE_BLOCK_BLACKLIST = "indexReceiveBlockBlacklist";
/** /**
* <p><code>public static final String <strong>INDEX_DIST_ALLOW_WHILE_CRAWLING</strong> = "allowDistributeIndexWhileCrawling"</code></p> * <p><code>public static final String <strong>INDEX_DIST_ALLOW_WHILE_CRAWLING</strong> = "allowDistributeIndexWhileCrawling"</code></p>
* <p>Name of the setting whether Index Distribution shall be allowed while crawling is in progress, i.e. * <p>Name of the setting whether Index Distribution shall be allowed while crawling is in progress, i.e.

@ -245,7 +245,7 @@ public final class SearchEvent {
this.IAmaxcounthash = null; this.IAmaxcounthash = null;
this.IAneardhthash = null; this.IAneardhthash = null;
this.localSearchThread = null; this.localSearchThread = null;
this.remote = (peers != null && peers.sizeConnected() > 0) && (this.query.domType == QueryParams.Searchdom.CLUSTER || (this.query.domType == QueryParams.Searchdom.GLOBAL && Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false))); this.remote = (peers != null && peers.sizeConnected() > 0) && (this.query.domType == QueryParams.Searchdom.CLUSTER || (this.query.domType == QueryParams.Searchdom.GLOBAL && Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, false)));
this.local_rwi_available = new AtomicInteger(0); // the number of results in the local peer after filtering this.local_rwi_available = new AtomicInteger(0); // the number of results in the local peer after filtering
this.local_rwi_stored = new AtomicInteger(0); this.local_rwi_stored = new AtomicInteger(0);
this.local_solr_available = new AtomicInteger(0); this.local_solr_available = new AtomicInteger(0);
@ -343,7 +343,7 @@ public final class SearchEvent {
} else { } else {
this.primarySearchThreadsL = null; this.primarySearchThreadsL = null;
this.nodeSearchThreads = null; this.nodeSearchThreads = null;
this.pollImmediately = !query.getSegment().connectedRWI() || !Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, false); this.pollImmediately = !query.getSegment().connectedRWI() || !Switchboard.getSwitchboard().getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW_SEARCH, false);
if ( generateAbstracts ) { if ( generateAbstracts ) {
// we need the results now // we need the results now
try { try {

@ -205,6 +205,10 @@ public class serverObjects implements Serializable, Cloneable {
return; return;
} }
public void put(final String key, final boolean value) {
put(key, value ? "1" : "0");
}
public void put(final String key, final String value) { public void put(final String key, final String value) {
if (key == null) { if (key == null) {
// this does nothing // this does nothing

Loading…
Cancel
Save