Skip to content

Commit

Permalink
added another link double-check
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4434 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Feb 3, 2008
1 parent a5d388b commit 42c1e11
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
22 changes: 22 additions & 0 deletions source/de/anomic/plasma/plasmaWordIndex.java
Expand Up @@ -51,6 +51,7 @@
import de.anomic.kelondro.kelondroMergeIterator;
import de.anomic.kelondro.kelondroOrder;
import de.anomic.kelondro.kelondroRotateIterator;
import de.anomic.kelondro.kelondroRowSet;
import de.anomic.plasma.urlPattern.plasmaURLPattern;
import de.anomic.server.serverMemory;
import de.anomic.server.logging.serverLog;
Expand Down Expand Up @@ -361,6 +362,27 @@ public indexContainer getContainer(String wordHash, Set<String> urlselection) {
container.addAllUnique(collections.getContainer(wordHash, urlselection));
}
}

// check doubles
int beforeDouble = container.size();
ArrayList<kelondroRowSet> d = container.removeDoubles();
kelondroRowSet set;
for (int i = 0; i < d.size(); i++) {
// for each element in the double-set, take that one that is the most recent one
set = d.get(i);
indexRWIRowEntry e, elm = null;
long lm = 0;
for (int j = 0; j < set.size(); j++) {
e = new indexRWIRowEntry(set.get(j));
if ((elm == null) || (e.lastModified() > lm)) {
elm = e;
lm = e.lastModified();
}
}
container.addUnique(elm.toKelondroEntry());
}
if (container.size() < beforeDouble) System.out.println("*** DEBUG DOUBLECHECK - removed " + (beforeDouble - container.size()) + " index entries from word container " + container.getWordHash());

return container;
}

Expand Down
12 changes: 6 additions & 6 deletions source/de/anomic/yacy/yacyClient.java
Expand Up @@ -572,11 +572,6 @@ public static String[] search(
}
}

// insert the containers to the index
for (int m = 0; m < words; m++) {
wordIndex.addEntries(container[m], true);
}

// read index abstract
if (abstractCache != null) {
Iterator<Map.Entry<String, String>> i = result.entrySet().iterator();
Expand All @@ -600,7 +595,12 @@ public static String[] search(
}
}

// generate statistics
// insert the containers to the index
for (int m = 0; m < words; m++) {
wordIndex.addEntries(container[m], true);
}

// generate statistics
long searchtime;
try {
searchtime = Integer.parseInt((String) result.get("searchtime"));
Expand Down

0 comments on commit 42c1e11

Please sign in to comment.