diff --git a/source/de/anomic/search/RankingProcess.java b/source/de/anomic/search/RankingProcess.java index 514492278..493153daa 100644 --- a/source/de/anomic/search/RankingProcess.java +++ b/source/de/anomic/search/RankingProcess.java @@ -79,7 +79,7 @@ public final class RankingProcess extends Thread { private final ScoreMap ref; // reference score computation for the commonSense heuristic private final ScoreMap hostNavigator; // a counter for the appearance of the host hash - private final Map hostResolver; // a mapping from a host hash (6 bytes) to the full url hash of one of these urls that have the host hash + private final Map hostResolver; // a mapping from a host hash (6 bytes) to the full url hash of one of these urls that have the host hash private final ScoreMap authorNavigator; private final ScoreMap namespaceNavigator; private final ReferenceOrder order; @@ -109,7 +109,7 @@ public final class RankingProcess extends Thread { this.flagcount = new int[32]; for (int i = 0; i < 32; i++) {this.flagcount[i] = 0;} this.hostNavigator = new ConcurrentScoreMap(); - this.hostResolver = new ConcurrentHashMap(); + this.hostResolver = new ConcurrentHashMap(); this.authorNavigator = new ConcurrentScoreMap(); this.namespaceNavigator = new ConcurrentScoreMap(); this.ref = new ConcurrentScoreMap(); @@ -226,13 +226,12 @@ public final class RankingProcess extends Thread { //this.domZones[DigestURI.domDomain(iEntry.metadataHash())]++; // check site constraints - String urlhashs = ASCII.String(iEntry.urlhash()); - String hosthash = urlhashs.substring(6); + String hosthash = new String(iEntry.urlhash(), 6, 6); if (query.sitehash == null) { // no site constraint there; maybe collect host navigation information if (nav_hosts && query.urlMask_isCatchall) { this.hostNavigator.inc(hosthash); - this.hostResolver.put(hosthash, urlhashs); + this.hostResolver.put(hosthash, iEntry.urlhash()); } } else { if (!hosthash.equals(query.sitehash)) { @@ -597,15 +596,16 @@ public final class RankingProcess extends Thread { final Iterator domhashs = this.hostNavigator.keys(false); URIMetadataRow row; - String domhash, urlhash, hostname; + byte[] urlhash; + String hosthash, hostname; if (this.hostResolver != null) while (domhashs.hasNext() && result.sizeSmaller(30)) { - domhash = domhashs.next(); - if (domhash == null) continue; - urlhash = this.hostResolver.get(domhash); - row = urlhash == null ? null : this.query.getSegment().urlMetadata().load(ASCII.getBytes(urlhash)); + hosthash = domhashs.next(); + if (hosthash == null) continue; + urlhash = this.hostResolver.get(hosthash); + row = urlhash == null ? null : this.query.getSegment().urlMetadata().load(urlhash); hostname = row == null ? null : row.metadata().url().getHost(); if (hostname != null) { - result.set(hostname, this.hostNavigator.get(domhash)); + result.set(hostname, this.hostNavigator.get(hosthash)); } } if (result.sizeSmaller(2)) result.clear(); // navigators with one entry are not useful