From 9c51dc0f137a9e75ab2fa18d661aeced3e209ac9 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Fri, 24 Feb 2012 02:28:40 +0100 Subject: [PATCH] fixed a bug with navigation: if a navigation was applied to file type or protocol, then it was not possible to remove that again. This is the fix for that. --- htroot/yacysearchtrailer.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.java index 4fe15ce61..fd5a2a2f9 100644 --- a/htroot/yacysearchtrailer.java +++ b/htroot/yacysearchtrailer.java @@ -240,7 +240,7 @@ public class yacysearchtrailer { 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, theQuery.urlMask.toString(), theQuery.navigators).toString()); + prop.put(fileType, "nav-protocols_element_" + i + "_url", QueryParams.navurl(fileType.name().toLowerCase(), 0, theQuery, queryStringForUrl, (p >= 0 && theQuery.urlMask.toString().startsWith(name)) ? ".*" : theQuery.urlMask.toString(), theQuery.navigators).toString()); prop.put("nav-protocols_element_" + i + "_count", count); prop.put("nav-protocols_element_" + i + "_nl", 1); i++; @@ -279,7 +279,7 @@ public class yacysearchtrailer { prop.put(fileType, "nav-filetypes_element_" + i + "_modifier", "-" + nav); } prop.put(fileType, "nav-filetypes_element_" + i + "_name", name); - prop.put(fileType, "nav-filetypes_element_" + i + "_url", QueryParams.navurl(fileType.name().toLowerCase(), 0, theQuery, queryStringForUrl, theQuery.urlMask.toString(), theQuery.navigators).toString()); + prop.put(fileType, "nav-filetypes_element_" + i + "_url", QueryParams.navurl(fileType.name().toLowerCase(), 0, theQuery, queryStringForUrl, (p >= 0 && theQuery.urlMask.toString().endsWith(name)) ? ".*" : theQuery.urlMask.toString(), theQuery.navigators).toString()); prop.put("nav-filetypes_element_" + i + "_count", count); prop.put("nav-filetypes_element_" + i + "_nl", 1); i++; @@ -371,3 +371,5 @@ public class yacysearchtrailer { } } +//http://localhost:8090/yacysearch.html?query=java+&maximumRecords=10&resource=local&verify=cacheonly&nav=hosts,authors,namespace,topics,filetype,protocol&urlmaskfilter=ftp://.*&prefermaskfilter=&cat=href&constraint=&contentdom=text&former=java+%2Fftp&startRecord=0 +//http://localhost:8090/yacysearch.html?query=java+&maximumRecords=10&resource=local&verify=cacheonly&nav=hosts,authors,namespace,topics,filetype,protocol&urlmaskfilter=.*&prefermaskfilter=&cat=href&constraint=&contentdom=text&former=java+%2Fvocabulary%2FGewerke%2FTore&startRecord=0