fix for last commit

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2545 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
orbiter 2006-09-11 11:12:42 +00:00
parent 82a6054275
commit a7281a9b4d
3 changed files with 8 additions and 5 deletions

View File

@ -111,7 +111,7 @@ public class indexCollectionRI extends indexAbstractRI implements indexRI {
public indexContainer getContainer(String wordHash, Set urlselection, boolean deleteIfEmpty, long maxtime) {
try {
kelondroRowSet collection = collectionIndex.get(wordHash.getBytes(), deleteIfEmpty);
collection.select(urlselection);
if (collection != null) collection.select(urlselection);
if ((collection == null) || (collection.size() == 0)) return null;
return new indexRowSetContainer(wordHash, collection);
} catch (IOException e) {

View File

@ -136,7 +136,8 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
searchThreads = yacySearch.searchHashes(query.queryHashes, query.prefer, query.urlMask, query.maxDistance, urlStore, rcContainers, rcAbstracts, fetchpeers, plasmaSwitchboard.urlBlacklist, snippetCache, profileGlobal, ranking);
// meanwhile do a local search
indexContainer rcLocal = localSearchJoin(localSearchContainers(null).values());
Map searchContainerMap = localSearchContainers(null);
indexContainer rcLocal = localSearchJoin((searchContainerMap == null) ? null : searchContainerMap.values());
plasmaSearchResult localResult = orderLocal(rcLocal, timeout);
// catch up global results:
@ -166,7 +167,8 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
lastEvent = this;
return result;
} else {
indexContainer rcLocal = localSearchJoin(localSearchContainers(null).values());
Map searchContainerMap = localSearchContainers(null);
indexContainer rcLocal = localSearchJoin((searchContainerMap == null) ? null : searchContainerMap.values());
plasmaSearchResult result = order(rcLocal);
result.localContributions = rcLocal.size();
@ -179,7 +181,7 @@ public final class plasmaSearchEvent extends Thread implements Runnable {
}
public Map localSearchContainers(Set urlselection) {
// search for the set of hashes and return the set of containers containing the seach result
// search for the set of hashes and return a map of of wordhash:indexContainer containing the seach result
// retrieve entities that belong to the hashes
profileLocal.startTimer();

View File

@ -361,6 +361,7 @@ public final class plasmaWordIndex extends indexAbstractRI implements indexRI {
}
public Map getContainers(Set wordHashes, Set urlselection, boolean deleteIfEmpty, boolean interruptIfEmpty, long maxTime) {
// return map of wordhash:indexContainer
// retrieve entities that belong to the hashes
HashMap containers = new HashMap();
@ -375,7 +376,7 @@ public final class plasmaWordIndex extends indexAbstractRI implements indexRI {
//if ((maxTime > 0) && (remaining <= 0)) break;
if ((maxTime >= 0) && (remaining <= 0)) remaining = 100;
// get next hash:
// get next word hash:
singleHash = (String) i.next();
// retrieve index