Skip to content

Commit

Permalink
fix for last commit
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2545 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Sep 11, 2006
1 parent 82a6054 commit a7281a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/de/anomic/index/indexCollectionRI.java
Expand Up @@ -111,7 +111,7 @@ public void remove() {
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) {
Expand Down
8 changes: 5 additions & 3 deletions source/de/anomic/plasma/plasmaSearchEvent.java
Expand Up @@ -136,7 +136,8 @@ public plasmaSearchResult search() {
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:
Expand Down Expand Up @@ -166,7 +167,8 @@ public plasmaSearchResult search() {
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();

Expand All @@ -179,7 +181,7 @@ public plasmaSearchResult search() {
}

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();
Expand Down
3 changes: 2 additions & 1 deletion source/de/anomic/plasma/plasmaWordIndex.java
Expand Up @@ -361,6 +361,7 @@ public indexContainer getContainer(String wordHash, Set urlselection, boolean de
}

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();
Expand All @@ -375,7 +376,7 @@ public Map getContainers(Set wordHashes, Set urlselection, boolean deleteIfEmpty
//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
Expand Down

0 comments on commit a7281a9

Please sign in to comment.