re-introduced global search limitation when index receive is switched off

this was necessary because othervise robinson peers did also global searches, which cannot be a wanted effect

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4456 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent a8d336c379
commit 159aaf8889

@ -234,7 +234,7 @@ public class yacysearch {
// prepare search properties
final boolean yacyonline = ((yacyCore.seedDB != null) && (yacyCore.seedDB.mySeed() != null) && (yacyCore.seedDB.mySeed().getPublicAddress() != null));
final boolean globalsearch = (global) && (yacyonline);
final boolean globalsearch = (global) && (yacyonline) && (sb.getConfigBool(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, false));
// do the search
TreeSet<String> queryHashes = plasmaCondenser.words2hashes(query[0]);

@ -582,23 +582,18 @@ public final class plasmaSearchEvent {
if ((localSearchThread != null) && (localSearchThread.isAlive())) {
// in case that the local search takes longer than some other remote search requests,
// do some sleeps to give the local process a chance to contribute
try {Thread.sleep(200);} catch (InterruptedException e) {}
try {Thread.sleep(item * 100);} catch (InterruptedException e) {}
}
// now wait until as many remote worker threads have finished, as we want to display results
while ((this.primarySearchThreads != null) && (this.primarySearchThreads.length > item) && (anyWorkerAlive()) &&
((this.resultList.size() <= item) || (countFinishedRemoteSearch() <= item))) {
try {Thread.sleep(100);} catch (InterruptedException e) {}
}
// finally wait until enough results are there produced from the snippet fetch process
while ((anyWorkerAlive()) && (this.resultList.size() <= item)) {
try {Thread.sleep(100);} catch (InterruptedException e) {}
}
} else {
// we did a local search. If we arrive here, the local search process was finished
// and the only things we need to wait for are snippets from snippet fetch processes
while ((anyWorkerAlive()) && (this.resultList.size() <= item)) {
try {Thread.sleep(100);} catch (InterruptedException e) {}
}
}
// finally wait until enough results are there produced from the snippet fetch process
while ((anyWorkerAlive()) && (this.resultList.size() <= item)) {
try {Thread.sleep(100);} catch (InterruptedException e) {}
}
// finally, if there is something, return the result

Loading…
Cancel
Save