fix for host navigator

pull/1/head
Michael Peter Christen 13 years ago
parent 4c5edab1ec
commit 2ea585d616

@ -376,6 +376,13 @@ public class URIMetadataRow implements URIMetadata {
return this.entry.getPrimaryKeyBytes(); return this.entry.getPrimaryKeyBytes();
} }
private String hostHash = null;
public String hosthash() {
if (this.hostHash != null) return this.hostHash;
this.hostHash = ASCII.String(this.entry.getPrimaryKeyBytes(), 6, 6);
return this.hostHash;
}
public long ranking() { public long ranking() {
return this.ranking; return this.ranking;
} }

@ -307,15 +307,6 @@ public final class RWIProcess extends Thread
} }
} }
// check tld domain
/*
if ((DigestURI.domDomain(iEntry.metadataHash()) & this.query.zonecode) == 0) {
// filter out all tld that do not match with wanted tld domain
this.sortout++;
continue;
}
*/
// count domZones // count domZones
//this.domZones[DigestURI.domDomain(iEntry.metadataHash())]++; //this.domZones[DigestURI.domDomain(iEntry.metadataHash())]++;
@ -331,8 +322,9 @@ public final class RWIProcess extends Thread
continue pollloop; continue pollloop;
} }
} }
// collect host navigation information (even if we have only one; this is to provide a switch-off button) // collect host navigation information (even if we have only one; this is to provide a switch-off button)
if ( nav_hosts || this.query.urlMask_isCatchall ) { if (this.query.navigators.isEmpty() && (nav_hosts || this.query.urlMask_isCatchall)) {
this.hostNavigator.inc(hosthash); this.hostNavigator.inc(hosthash);
this.hostResolver.put(hosthash, iEntry.urlhash()); this.hostResolver.put(hosthash, iEntry.urlhash());
} }
@ -675,6 +667,15 @@ public final class RWIProcess extends Thread
continue; continue;
} }
// from here: collect navigation information
// collect host navigation information (even if we have only one; this is to provide a switch-off button)
if (!this.query.navigators.isEmpty() && (this.query.urlMask_isCatchall || this.query.navigators.equals("all") || this.query.navigators.indexOf("hosts", 0) >= 0)) {
final String hosthash = page.hosthash();
this.hostNavigator.inc(hosthash);
this.hostResolver.put(hosthash, page.hash());
}
// namespace navigation // namespace navigation
String pagepath = page.url().getPath(); String pagepath = page.url().getPath();
if ( (p = pagepath.indexOf(':')) >= 0 ) { if ( (p = pagepath.indexOf(':')) >= 0 ) {

Loading…
Cancel
Save