Author: orbiter
Date: 2008-02-06 21:29:22 +0100 (Wed, 06 Feb 2008)
New Revision: 4456
Modified:
trunk/htroot/yacysearch.java
trunk/source/de/anomic/plasma/plasmaSearchEvent.java
Log:
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
Modified: trunk/htroot/yacysearch.java
===================================================================
--- trunk/htroot/yacysearch.java 2008-02-06 19:48:41 UTC (rev 4455)
+++ trunk/htroot/yacysearch.java 2008-02-06 20:29:22 UTC (rev 4456)
@@ -234,7 +234,7 @@
// 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]);
Modified: trunk/source/de/anomic/plasma/plasmaSearchEvent.java
===================================================================
--- trunk/source/de/anomic/plasma/plasmaSearchEvent.java 2008-02-06
19:48:41 UTC (rev 4455)
+++ trunk/source/de/anomic/plasma/plasmaSearchEvent.java 2008-02-06
20:29:22 UTC (rev 4456)
@@ -582,24 +582,19 @@
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
synchronized (this.resultList) {
_______________________________________________
YaCy-svn mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/yacy-svn