git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6275 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 0ba1beaf56
commit 92407009b2

@ -124,52 +124,6 @@ public class ReferenceOrder {
return n.decoded();
}
/*
public ArrayList<WordReferenceVars> normalizeWith(final ReferenceContainer<WordReference> container) {
// normalize ranking: find minimum and maximum of separate ranking criteria
assert (container != null);
BlockingQueue<WordReferenceVars> vars = WordReferenceVars.transform(container);
WordReferenceVars entryMin = null;
WordReferenceVars entryMax = null;
HashMap<String, Integer> doms = new HashMap<String, Integer>();
Integer int1 = 1;
ArrayList<WordReferenceVars> decodedEntries = new ArrayList<WordReferenceVars>();
WordReferenceVars iEntry;
String dom;
Integer count;
try {
while ((iEntry = vars.take()) != WordReferenceVars.poison) {
decodedEntries.add(iEntry);
// find min/max
if (entryMin == null) entryMin = iEntry.clone(); else entryMin.min(iEntry);
if (entryMax == null) entryMax = iEntry.clone(); else entryMax.max(iEntry);
// update domcount
dom = iEntry.metadataHash().substring(6);
count = doms.get(dom);
if (count == null) {
doms.put(dom, int1);
} else {
doms.put(dom, Integer.valueOf(count.intValue() + 1));
}
}
} catch (InterruptedException e) {}
if (this.min == null) this.min = entryMin.clone(); else this.min.min(entryMin);
if (this.max == null) this.max = entryMax.clone(); else this.max.max(entryMax);
Map.Entry<String, Integer> entry;
final Iterator<Map.Entry<String, Integer>> di = doms.entrySet().iterator();
while (di.hasNext()) {
entry = di.next();
this.doms.addScore(entry.getKey(), (entry.getValue()).intValue());
}
if (this.doms.size() > 0) this.maxdomcount = this.doms.getMaxScore();
return decodedEntries;
}
*/
public int authority(final String urlHash) {
return (doms.getScore(urlHash.substring(6)) << 8) / (1 + this.maxdomcount);
}

@ -176,7 +176,8 @@ public final class RankingProcess extends Thread {
boolean nav_hosts = this.query.navigators.equals("all") || this.query.navigators.indexOf("hosts") >= 0;
WordReferenceVars iEntry;
final ArrayList<WordReferenceVars> filteredEntries = new ArrayList<WordReferenceVars>();
// apply all filter
// apply all constraints
try {
while ((iEntry = decodedEntries.take()) != WordReferenceVars.poison) {
assert (iEntry.metadataHash().length() == index.row().primaryKeyLength);
@ -256,7 +257,7 @@ public final class RankingProcess extends Thread {
}
}
//if ((query.neededResults() > 0) && (container.size() > query.neededResults())) remove(true, true);
serverProfiling.update("SEARCH", new ProfilingGraph.searchEvent(query.id(true), SearchEvent.PRESORT, index.size(), System.currentTimeMillis() - timer), false);
}

Loading…
Cancel
Save