fix for wrong urls in navigator when a tenant is used

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6119 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 76b96337e2
commit 57af311627

@ -189,6 +189,7 @@ public final class search {
abstractSet,
new TreeSet<byte[]>(Base64Order.enhancedCoder),
null,
null,
rankingProfile,
maxdist,
prefer,
@ -241,6 +242,7 @@ public final class search {
queryhashes,
excludehashes,
null,
null,
rankingProfile,
maxdist,
prefer,

@ -271,9 +271,11 @@ public class yacysearch {
}
}
}
String tenant = null;
if (post.containsKey("tenant")) {
final String tenant = post.get("tenant");
if (urlmask == null) urlmask = ".*" + tenant + ".*"; else urlmask = ".*" + tenant + urlmask;
tenant = post.get("tenant");
if (tenant != null && tenant.length() == 0) tenant = null;
if (urlmask == null && tenant != null) urlmask = ".*" + tenant + ".*"; else urlmask = ".*" + tenant + urlmask;
}
int site = querystring.indexOf("site:");
String sitehash = null;
@ -410,6 +412,7 @@ public class yacysearch {
queryHashes,
Word.words2hashes(query[1]),
Word.words2hashes(query[2]),
tenant,
ranking,
maxDistance,
prefermask,

@ -472,12 +472,16 @@ public final class plasmaSearchRankingProcess {
ArrayList<NavigatorEntry> result = new ArrayList<NavigatorEntry>();
URLMetadataRow mr;
yacyURL url;
String hostname;
for (int i = 0; i < rc; i++) {
mr = indexSegment.urlMetadata().load(hsa[i].hashsample, null, 0);
if (mr == null) continue;
url = mr.metadata().url();
if (url == null) continue;
result.add(new NavigatorEntry(url.getHost(), hsa[i].count));
hostname = url.getHost();
if (hostname == null) continue;
if (query.tenant != null && !hostname.contains(query.tenant)) continue;
result.add(new NavigatorEntry(hostname, hsa[i].count));
}
return result;
}

@ -75,6 +75,7 @@ public final class Query {
public String host; // this is the client host that starts the query, not a site operator
public String sitehash; // this is a domain hash, 6 bytes long or null
public String authorhash;
public String tenant;
public yacySeed remotepeer;
public Long handle;
// values that are set after a search:
@ -99,6 +100,7 @@ public final class Query {
this.fullqueryHashes = Word.words2hashes(cq[2]);
}
this.ranking = ranking;
this.tenant = null;
this.maxDistance = Integer.MAX_VALUE;
this.prefer = "";
this.contentdom = CONTENTDOM_ALL;
@ -125,6 +127,7 @@ public final class Query {
final String queryString, final TreeSet<byte[]> queryHashes,
final TreeSet<byte[]> excludeHashes,
final TreeSet<byte[]> fullqueryHashes,
final String tenant,
final RankingProfile ranking,
final int maxDistance, final String prefer, final int contentdom,
final String language,
@ -142,6 +145,7 @@ public final class Query {
this.queryHashes = queryHashes;
this.excludeHashes = excludeHashes;
this.fullqueryHashes = fullqueryHashes;
this.tenant = tenant;
this.ranking = ranking;
this.maxDistance = maxDistance;
this.prefer = prefer;

Loading…
Cancel
Save