|
|
|
@ -128,6 +128,15 @@ public class yacysearch {
|
|
|
|
|
final boolean indexof = (post != null && post.get("indexof","").equals("on"));
|
|
|
|
|
|
|
|
|
|
String urlmask = null;
|
|
|
|
|
String originalUrlMask = null;
|
|
|
|
|
if (post.containsKey("urlmask") && post.get("urlmask").equals("no")) { // option search all
|
|
|
|
|
originalUrlMask = ".*";
|
|
|
|
|
} else if (!newsearch && post.containsKey("urlmaskfilter")) {
|
|
|
|
|
originalUrlMask = post.get("urlmaskfilter", ".*");
|
|
|
|
|
} else {
|
|
|
|
|
originalUrlMask = ".*";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String prefermask = (post == null ? "" : post.get("prefermaskfilter", ""));
|
|
|
|
|
if ((prefermask.length() > 0) && (prefermask.indexOf(".*") < 0)) prefermask = ".*" + prefermask + ".*";
|
|
|
|
|
|
|
|
|
@ -256,14 +265,14 @@ public class yacysearch {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (urlmask == null){
|
|
|
|
|
if (post.containsKey("urlmask") && post.get("urlmask").equals("no")) { // option search all
|
|
|
|
|
urlmask = ".*";
|
|
|
|
|
} else if (!newsearch && post.containsKey("urlmaskfilter")) {
|
|
|
|
|
urlmask = post.get("urlmaskfilter", ".*");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (urlmask == null || urlmask.length() == 0) urlmask = ".*"; //if no urlmask was given
|
|
|
|
|
// if (urlmask == null){
|
|
|
|
|
// if (post.containsKey("urlmask") && post.get("urlmask").equals("no")) { // option search all
|
|
|
|
|
// urlmask = ".*";
|
|
|
|
|
// } else if (!newsearch && post.containsKey("urlmaskfilter")) {
|
|
|
|
|
// urlmask = post.get("urlmaskfilter", ".*");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (urlmask == null || urlmask.length() == 0) urlmask = originalUrlMask; //if no urlmask was given
|
|
|
|
|
|
|
|
|
|
// read the language from the language-restrict option 'lr'
|
|
|
|
|
// if no one is given, use the user agent or the system language as default
|
|
|
|
@ -417,7 +426,7 @@ public class yacysearch {
|
|
|
|
|
final StringBuilder resnav = new StringBuilder();
|
|
|
|
|
final int thispage = offset / theQuery.displayResults();
|
|
|
|
|
if (thispage == 0) resnav.append("< "); else {
|
|
|
|
|
resnav.append(navurla(thispage - 1, display, theQuery));
|
|
|
|
|
resnav.append(navurla(thispage - 1, display, theQuery, originalUrlMask));
|
|
|
|
|
resnav.append("<strong><</strong></a> ");
|
|
|
|
|
}
|
|
|
|
|
final int numberofpages = Math.min(10, Math.max(thispage + 2, totalcount / theQuery.displayResults()));
|
|
|
|
@ -427,13 +436,13 @@ public class yacysearch {
|
|
|
|
|
resnav.append(i + 1);
|
|
|
|
|
resnav.append("</strong> ");
|
|
|
|
|
} else {
|
|
|
|
|
resnav.append(navurla(i, display, theQuery));
|
|
|
|
|
resnav.append(navurla(i, display, theQuery, originalUrlMask));
|
|
|
|
|
resnav.append(i + 1);
|
|
|
|
|
resnav.append("</a> ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (thispage >= numberofpages) resnav.append(">"); else {
|
|
|
|
|
resnav.append(navurla(thispage + 1, display, theQuery));
|
|
|
|
|
resnav.append(navurla(thispage + 1, display, theQuery, originalUrlMask));
|
|
|
|
|
resnav.append("<strong>></strong></a>");
|
|
|
|
|
}
|
|
|
|
|
prop.put("num-results_resnav", resnav.toString());
|
|
|
|
@ -485,7 +494,7 @@ public class yacysearch {
|
|
|
|
|
prop.put("input_count", itemsPerPage);
|
|
|
|
|
prop.put("input_offset", offset);
|
|
|
|
|
prop.put("input_resource", global ? "global" : "local");
|
|
|
|
|
prop.putHTML("input_urlmaskfilter", urlmask);
|
|
|
|
|
prop.putHTML("input_urlmaskfilter", originalUrlMask);
|
|
|
|
|
prop.putHTML("input_prefermaskfilter", prefermask);
|
|
|
|
|
prop.put("input_indexof", (indexof) ? "on" : "off");
|
|
|
|
|
prop.put("input_constraint", (constraint == null) ? "" : constraint.exportB64());
|
|
|
|
@ -510,7 +519,7 @@ public class yacysearch {
|
|
|
|
|
/**
|
|
|
|
|
* generates the page navigation bar
|
|
|
|
|
*/
|
|
|
|
|
private static String navurla(final int page, final int display, final plasmaSearchQuery theQuery) {
|
|
|
|
|
private static String navurla(final int page, final int display, final plasmaSearchQuery theQuery, final String originalUrlMask) {
|
|
|
|
|
return
|
|
|
|
|
"<a href=\"yacysearch.html?display=" + display +
|
|
|
|
|
"&search=" + theQuery.queryString(true) +
|
|
|
|
@ -518,7 +527,7 @@ public class yacysearch {
|
|
|
|
|
"&startRecord=" + (page * theQuery.displayResults()) +
|
|
|
|
|
"&resource=" + ((theQuery.isLocal()) ? "local" : "global") +
|
|
|
|
|
"&verify=" + ((theQuery.onlineSnippetFetch) ? "true" : "false") +
|
|
|
|
|
"&urlmaskfilter=" + theQuery.urlMask +
|
|
|
|
|
"&urlmaskfilter=" + originalUrlMask +
|
|
|
|
|
"&prefermaskfilter=" + theQuery.prefer +
|
|
|
|
|
"&cat=href&constraint=" + ((theQuery.constraint == null) ? "" : theQuery.constraint.exportB64()) +
|
|
|
|
|
"&contentdom=" + theQuery.contentdom() +
|
|
|
|
|