fixed type/cat properties

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2002 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 47b541b2d1
commit c5087710a4

@ -117,7 +117,8 @@ public class index {
prop.put("results", ""); prop.put("results", "");
prop.put("urlmaskoptions", 0); prop.put("urlmaskoptions", 0);
prop.put("urlmaskoptions_urlmaskfilter", ".*"); prop.put("urlmaskoptions_urlmaskfilter", ".*");
prop.put("type", "href"); prop.put("cat", "href");
prop.put("type", "0");
prop.put("depth", "0"); prop.put("depth", "0");
return prop; return prop;
} }

@ -51,6 +51,7 @@ picPlus.src = "/env/grafics/plus.gif";
<input type="hidden" name="time" value="#[time]#"> <input type="hidden" name="time" value="#[time]#">
<input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#"> <input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#">
<input type="hidden" name="depth" value="#[depth]#"> <input type="hidden" name="depth" value="#[depth]#">
<input type="hidden" name="cat" value="#[cat]#">
<input type="hidden" name="type" value="#[type]#"> <input type="hidden" name="type" value="#[type]#">
</form> </form>
</p><hr> </p><hr>

@ -108,7 +108,7 @@ public class yacysearch {
prop.put("resource", "global"); prop.put("resource", "global");
prop.put("time", 6); prop.put("time", 6);
prop.put("urlmaskfilter", ".*"); prop.put("urlmaskfilter", ".*");
prop.put("type", "href"); prop.put("cat", "href");
prop.put("depth", "0"); prop.put("depth", "0");
prop.put("type", 0); prop.put("type", 0);
prop.put("type_excluded", 0); prop.put("type_excluded", 0);
@ -131,7 +131,7 @@ public class yacysearch {
serverObjects prop = new serverObjects(); serverObjects prop = new serverObjects();
if (post.get("type", "href").equals("href")) { if (post.get("cat", "href").equals("href")) {
prop.put("type", 0); // set type of result: normal link list prop.put("type", 0); // set type of result: normal link list
final TreeSet query = plasmaSearchQuery.cleanQuery(querystring); final TreeSet query = plasmaSearchQuery.cleanQuery(querystring);
@ -299,7 +299,8 @@ public class yacysearch {
prop.put("resource", (global) ? "global" : "local"); prop.put("resource", (global) ? "global" : "local");
prop.put("time", searchtime / 1000); prop.put("time", searchtime / 1000);
prop.put("urlmaskfilter", urlmask); prop.put("urlmaskfilter", urlmask);
prop.put("type", "href"); prop.put("type", "0");
prop.put("cat", "href");
prop.put("depth", "0"); prop.put("depth", "0");
// adding some additional properties needed for the rss feed // adding some additional properties needed for the rss feed
@ -309,28 +310,25 @@ public class yacysearch {
} }
if (post.get("type", "href").equals("image")) { if ((post.get("cat", "href").equals("image")) && (querystring.startsWith("http://"))) {
prop.put("type", 1); // set type of result: image list
int depth = post.getInt("depth", 0); int depth = post.getInt("depth", 0);
URL url = null;
if (querystring.startsWith("http://")) { try {url = new URL(querystring);} catch (MalformedURLException e) {}
try { plasmaSearchImages si = new plasmaSearchImages(sb.snippetCache, 6000, url, depth);
plasmaSearchImages si = new plasmaSearchImages(sb.snippetCache, 6000, new URL(querystring), depth); Iterator i = si.entries();
Iterator i = si.entries(); htmlFilterImageEntry ie;
htmlFilterImageEntry ie; int c = 0;
int c = 0; while (i.hasNext()) {
while (i.hasNext()) { ie = (htmlFilterImageEntry) i.next();
ie = (htmlFilterImageEntry) i.next(); prop.put("type_results_" + c + "_url", ie.url().toString());
prop.put("type_results_" + c + "_url", ie.url().toString()); c++;
c++;
}
prop.put("type_results", c);
} catch (MalformedURLException e) {}
} }
prop.put("type_results", c);
prop.put("cat", "image");
prop.put("type", 1); // set type of result: image list
prop.put("former", post.get("search", "")); prop.put("former", post.get("search", ""));
prop.put("type", "image");
prop.put("depth", depth); prop.put("depth", depth);
} }
// return rewrite properties // return rewrite properties

Loading…
Cancel
Save