Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
made the protocol navigator reversible
Michael Peter Christen558ab7bd4eb1
diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.javaindex 41dc87889..28d735fbb 100644--- a/htroot/yacysearchtrailer.java+++ b/htroot/yacysearchtrailer.java@@ -190,13 +190,20 @@ public class yacysearchtrailer {while (i < 20 && navigatorIterator.hasNext()) {name = navigatorIterator.next().trim();count = protocolNavigator.get(name);- nav = "/" + name;+ nav = "%2F" + name;queryStringForUrl = theQuery.queryStringForUrl();p = queryStringForUrl.indexOf(nav);- prop.put("nav-protocols_element_" + i + "_on", 1);- prop.put(fileType, "nav-protocols_element_" + i + "_modifier", nav);+ if (p < 0) {+ queryStringForUrl += "+" + nav;+ prop.put("nav-protocols_element_" + i + "_on", 1);+ prop.put(fileType, "nav-protocols_element_" + i + "_modifier", nav);+ } else {+ queryStringForUrl = (queryStringForUrl.substring(0, p) + queryStringForUrl.substring(p + nav.length())).trim();+ prop.put("nav-protocols_element_" + i + "_on", 0);+ prop.put(fileType, "nav-protocols_element_" + i + "_modifier", nav);+ }prop.put(fileType, "nav-protocols_element_" + i + "_name", name);- prop.put(fileType, "nav-protocols_element_" + i + "_url", QueryParams.navurl(fileType.name().toLowerCase(), 0, theQuery, queryStringForUrl + "+" + nav, theQuery.urlMask.toString(), theQuery.navigators).toString());+ prop.put(fileType, "nav-protocols_element_" + i + "_url", QueryParams.navurl(fileType.name().toLowerCase(), 0, theQuery, queryStringForUrl, theQuery.urlMask.toString(), theQuery.navigators).toString());prop.put("nav-protocols_element_" + i + "_count", count);prop.put("nav-protocols_element_" + i + "_nl", 1);i++;diff --git a/source/net/yacy/search/query/RWIProcess.java b/source/net/yacy/search/query/RWIProcess.javaindex 24fc72ad1..1238987fe 100644--- a/source/net/yacy/search/query/RWIProcess.java+++ b/source/net/yacy/search/query/RWIProcess.java@@ -835,9 +835,6 @@ public final class RWIProcess extends Threadif ( !this.query.navigators.equals("all") && this.query.navigators.indexOf("protocol", 0) < 0 ) {return new ClusteredScoreMap<String>();}- if ( this.protocolNavigator.sizeSmaller(2) ) {- this.protocolNavigator.clear(); // navigators with one entry are not useful- }return this.protocolNavigator;}