Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- made image search in interactive search using the ViewImage servlet - that enables viewing of images for intranet SMB servers. - added a filter search for protocol, tld and ext again; otherwise p2p search produces a lot of rubbish

Michael Peter Christene1f89efd0d48
diff --git a/htroot/js/yacyinteractive.js b/htroot/js/yacyinteractive.js
index 045092408..9c99d37b0 100644
--- a/htroot/js/yacyinteractive.js
+++ b/htroot/js/yacyinteractive.js
@@ -78,7 +78,7 @@ function preparepage(str) {
if (modifier != "") modifiertype = modifier.substring(modifier.length - 3)
- if (modifiertype == "png" || modifiertype == "gif" || modifiertype == "jpg") {
+ if (modifiertype == "png" || modifiertype == "gif" || modifiertype == "jpg" || modifiertype == "PNG" || modifiertype == "GIF" || modifiertype == "JPG") {
var tt = resultImages();
document.getElementById("searchresults").innerHTML = tt;
} else {
@@ -220,8 +220,8 @@ function resultLine(type, item, linenumber) {
if (type == "image") {
html += "<div style=\"float:left\">";
html += "<a href=\"" + item.link + "\" class=\"thumblink\" onclick=\"return hs.expand(this)\">";
- //html += "<img src=\"/ViewImage.png?maxwidth=96&amp;maxheight=96&amp;code=" + item.code + "\" alt=\"" + title + "\" />";
- html += "<img src=\"" + item.link + "\" width=\"96\" height=\"96\" alt=\"" + title + "\" />";
+ html += "<img src=\"/ViewImage.png?maxwidth=96&amp;maxheight=96&amp;code=" + item.code + "\" alt=\"" + title + "\" />";
+ //html += "<img src=\"" + item.link + "\" width=\"96\" height=\"96\" alt=\"" + title + "\" />";
html += "</a>";
var name = title;
while ((p = name.indexOf("/")) >= 0) { name = name.substring(p + 1); }
diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.java
index 0b3b20342..80d74e3ea 100644
--- a/source/net/yacy/search/query/QueryParams.java
+++ b/source/net/yacy/search/query/QueryParams.java
@@ -111,9 +111,11 @@ public final class QueryParams {
private final QueryGoal queryGoal;
public int itemsPerPage;
public int offset;
- public final Pattern urlMask, prefer;
+ public Pattern urlMask;
+
+ public final Pattern prefer;
public final String protocol, tld, ext;
- final boolean urlMask_isCatchall;
+ boolean urlMask_isCatchall;
public final Classification.ContentDomain contentdom;
public final String targetlang;
protected final Collection<Tagging.Metatag> metatags;
@@ -246,6 +248,20 @@ public final class QueryParams {
throw new IllegalArgumentException("Not a valid regular expression: " + urlMask, ex);
}
this.urlMask_isCatchall = this.urlMask.toString().equals(catchall_pattern.toString());
+ if (this.urlMask_isCatchall) {
+ if (protocol != null) {
+ this.urlMask = Pattern.compile(protocol + ".*");
+ this.urlMask_isCatchall = false;
+ }
+ if (tld != null) {
+ this.urlMask = Pattern.compile(".*" + tld + ".*");
+ this.urlMask_isCatchall = false;
+ }
+ if (ext != null) {
+ this.urlMask = Pattern.compile(".*" + ext + ".*");
+ this.urlMask_isCatchall = false;
+ }
+ }
this.protocol = protocol;
this.tld = tld;
this.ext = ext;