Skip to content

Commit

Permalink
re-introduced global search limitation when index receive is switched…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
orbiter committed Feb 6, 2008
1 parent a8d336c commit 159aaf8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion htroot/yacysearch.java
Expand Up @@ -234,7 +234,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

// 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]);
Expand Down
17 changes: 6 additions & 11 deletions source/de/anomic/plasma/plasmaSearchEvent.java
Expand Up @@ -582,23 +582,18 @@ public ResultEntry oneResult(int item) {
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
Expand Down

0 comments on commit 159aaf8

Please sign in to comment.