Skip to content

Commit

Permalink
fixed type/cat properties
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2002 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 5, 2006
1 parent 47b541b commit c508771
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
3 changes: 2 additions & 1 deletion htroot/index.java
Expand Up @@ -117,7 +117,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("results", "");
prop.put("urlmaskoptions", 0);
prop.put("urlmaskoptions_urlmaskfilter", ".*");
prop.put("type", "href");
prop.put("cat", "href");
prop.put("type", "0");
prop.put("depth", "0");
return prop;
}
Expand Down
1 change: 1 addition & 0 deletions htroot/yacysearch.html
Expand Up @@ -51,6 +51,7 @@
<input type="hidden" name="time" value="#[time]#">
<input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#">
<input type="hidden" name="depth" value="#[depth]#">
<input type="hidden" name="cat" value="#[cat]#">
<input type="hidden" name="type" value="#[type]#">
</form>
</p><hr>
Expand Down
40 changes: 19 additions & 21 deletions htroot/yacysearch.java
Expand Up @@ -108,7 +108,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("resource", "global");
prop.put("time", 6);
prop.put("urlmaskfilter", ".*");
prop.put("type", "href");
prop.put("cat", "href");
prop.put("depth", "0");
prop.put("type", 0);
prop.put("type_excluded", 0);
Expand All @@ -131,7 +131,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

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

final TreeSet query = plasmaSearchQuery.cleanQuery(querystring);
Expand Down Expand Up @@ -299,7 +299,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("resource", (global) ? "global" : "local");
prop.put("time", searchtime / 1000);
prop.put("urlmaskfilter", urlmask);
prop.put("type", "href");
prop.put("type", "0");
prop.put("cat", "href");
prop.put("depth", "0");

// adding some additional properties needed for the rss feed
Expand All @@ -309,28 +310,25 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

}

if (post.get("type", "href").equals("image")) {
prop.put("type", 1); // set type of result: image list
if ((post.get("cat", "href").equals("image")) && (querystring.startsWith("http://"))) {

int depth = post.getInt("depth", 0);

if (querystring.startsWith("http://")) {
try {
plasmaSearchImages si = new plasmaSearchImages(sb.snippetCache, 6000, new URL(querystring), depth);
Iterator i = si.entries();
htmlFilterImageEntry ie;
int c = 0;
while (i.hasNext()) {
ie = (htmlFilterImageEntry) i.next();
prop.put("type_results_" + c + "_url", ie.url().toString());
c++;
}
prop.put("type_results", c);
} catch (MalformedURLException e) {}
URL url = null;
try {url = new URL(querystring);} catch (MalformedURLException e) {}
plasmaSearchImages si = new plasmaSearchImages(sb.snippetCache, 6000, url, depth);
Iterator i = si.entries();
htmlFilterImageEntry ie;
int c = 0;
while (i.hasNext()) {
ie = (htmlFilterImageEntry) i.next();
prop.put("type_results_" + c + "_url", ie.url().toString());
c++;
}

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("type", "image");
prop.put("depth", depth);
}
// return rewrite properties
Expand Down

0 comments on commit c508771

Please sign in to comment.