Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for host navigator

Michael Peter Christen2ea585d616bf
diff --git a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
index 756586c52..be805dbeb 100644
--- a/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
+++ b/source/net/yacy/kelondro/data/meta/URIMetadataRow.java
@@ -376,6 +376,13 @@ public class URIMetadataRow implements URIMetadata {
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() {
return this.ranking;
}
diff --git a/source/net/yacy/search/query/RWIProcess.java b/source/net/yacy/search/query/RWIProcess.java
index 9d5963f9a..104cacca1 100644
--- a/source/net/yacy/search/query/RWIProcess.java
+++ b/source/net/yacy/search/query/RWIProcess.java
@@ -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
//this.domZones[DigestURI.domDomain(iEntry.metadataHash())]++;
@@ -331,8 +322,9 @@ public final class RWIProcess extends Thread
continue pollloop;
}
}
+
// 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.hostResolver.put(hosthash, iEntry.urlhash());
}
@@ -675,6 +667,15 @@ public final class RWIProcess extends Thread
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
String pagepath = page.url().getPath();
if ( (p = pagepath.indexOf(':')) >= 0 ) {