Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for last commit

orbitera7281a9b4d3b
diff --git a/source/de/anomic/index/indexCollectionRI.java b/source/de/anomic/index/indexCollectionRI.java
index 0aca8b3df..31f6e5f61 100644
--- a/source/de/anomic/index/indexCollectionRI.java
+++ b/source/de/anomic/index/indexCollectionRI.java
@@ -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) {
diff --git a/source/de/anomic/plasma/plasmaSearchEvent.java b/source/de/anomic/plasma/plasmaSearchEvent.java
index 3670a1eaf..8e5bb0c5f 100644
--- a/source/de/anomic/plasma/plasmaSearchEvent.java
+++ b/source/de/anomic/plasma/plasmaSearchEvent.java
@@ -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();
diff --git a/source/de/anomic/plasma/plasmaWordIndex.java b/source/de/anomic/plasma/plasmaWordIndex.java
index 89d77761e..30d2dcf8b 100644
--- a/source/de/anomic/plasma/plasmaWordIndex.java
+++ b/source/de/anomic/plasma/plasmaWordIndex.java
@@ -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