added navigation keys for site and author facets to remote search interface

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6038 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 27fa6a66ad
commit e0b3984805

@ -92,7 +92,7 @@ public final class search {
String sitehash = post.get("sitehash", ""); if (sitehash.length() == 0) sitehash = null;
String authorhash = post.get("authorhash", ""); if (authorhash.length() == 0) authorhash = null;
String language = post.get("language", "");
if (!iso639.exists(language)) {
if (language == null || language.length() == 0 || !iso639.exists(language)) {
// take language from the user agent
String agent = header.get("User-Agent");
if (agent == null) agent = System.getProperty("user.language");

@ -157,7 +157,9 @@ public final class plasmaSearchEvent {
"",
query.prefer,
query.urlMask,
query.targetlang,
query.targetlang == null ? "" : query.targetlang,
query.sitehash == null ? "" : query.sitehash,
query.authorhash == null ? "" : query.authorhash,
query.displayResults(),
query.maxDistance,
indexSegment,

@ -426,6 +426,8 @@ public final class yacyClient {
final String prefer,
final String filter,
final String language,
final String sitehash,
final String authorhash,
final int count,
final int maxDistance,
final boolean global,
@ -469,6 +471,8 @@ public final class yacyClient {
post.add(new DefaultCharsetStringPart("prefer", prefer));
post.add(new DefaultCharsetStringPart("filter", filter));
post.add(new DefaultCharsetStringPart("language", language));
post.add(new DefaultCharsetStringPart("sitehash", sitehash));
post.add(new DefaultCharsetStringPart("authorhash", authorhash));
post.add(new DefaultCharsetStringPart("ttl", "0"));
post.add(new DefaultCharsetStringPart("maxdist", Integer.toString(maxDistance)));
post.add(new DefaultCharsetStringPart("profile", crypt.simpleEncode(rankingProfile.toExternalString())));

@ -44,7 +44,7 @@ import de.anomic.yacy.dht.PeerSelection;
public class yacySearch extends Thread {
final private String wordhashes, excludehashes, urlhashes;
final private String wordhashes, excludehashes, urlhashes, sitehash, authorhash;
final private boolean global;
final private int partitions;
final private Segment indexSegment;
@ -65,6 +65,8 @@ public class yacySearch extends Thread {
final String wordhashes, final String excludehashes,
final String urlhashes,
final String prefer, final String filter, final String language,
final String sitehash,
final String authorhash,
final int count, final int maxDistance,
final boolean global, final int partitions,
final yacySeed targetPeer,
@ -85,6 +87,8 @@ public class yacySearch extends Thread {
this.prefer = prefer;
this.filter = filter;
this.language = language;
this.sitehash = sitehash;
this.authorhash = authorhash;
this.global = global;
this.partitions = partitions;
this.indexSegment = indexSegment;
@ -105,7 +109,9 @@ public class yacySearch extends Thread {
try {
this.urls = yacyClient.search(
peers.mySeed(),
wordhashes, excludehashes, urlhashes, prefer, filter, language, count, maxDistance, global, partitions,
wordhashes, excludehashes, urlhashes, prefer, filter, language,
sitehash, authorhash,
count, maxDistance, global, partitions,
targetPeer, indexSegment, crawlResults, containerCache, abstractCache,
blacklist, rankingProfile, constraint);
if (urls != null) {
@ -241,6 +247,8 @@ public class yacySearch extends Thread {
public static yacySearch[] primaryRemoteSearches(
final String wordhashes, final String excludehashes, final String urlhashes,
final String prefer, final String filter, String language,
final String sitehash,
final String authorhash,
final int count, final int maxDist,
final Segment indexSegment,
final yacySeedDB peers,
@ -272,7 +280,10 @@ public class yacySearch extends Thread {
final yacySearch[] searchThreads = new yacySearch[targets];
for (int i = 0; i < targets; i++) {
if (targetPeers[i] == null || targetPeers[i].hash == null) continue;
searchThreads[i] = new yacySearch(wordhashes, excludehashes, urlhashes, prefer, filter, language, count, maxDist, true, targets, targetPeers[i],
searchThreads[i] = new yacySearch(
wordhashes, excludehashes, urlhashes, prefer, filter, language,
sitehash, authorhash,
count, maxDist, true, targets, targetPeers[i],
indexSegment, peers, crawlResults, containerCache, abstractCache, blacklist, rankingProfile, constraint);
searchThreads[i].start();
//try {Thread.sleep(20);} catch (InterruptedException e) {}
@ -298,7 +309,8 @@ public class yacySearch extends Thread {
final yacySeed targetPeer = peers.getConnected(targethash);
if (targetPeer == null || targetPeer.hash == null) return null;
if (clusterselection != null) targetPeer.setAlternativeAddress(clusterselection.get(targetPeer.hash.getBytes()));
final yacySearch searchThread = new yacySearch(wordhashes, excludehashes, urlhashes, "", "", "en", 0, 9999, true, 0, targetPeer,
final yacySearch searchThread = new yacySearch(
wordhashes, excludehashes, urlhashes, "", "", "", "", "", 0, 9999, true, 0, targetPeer,
indexSegment, peers, crawlResults, containerCache, new TreeMap<String, TreeMap<String, String>>(), blacklist, rankingProfile, constraint);
searchThread.start();
return searchThread;

Loading…
Cancel
Save