fixed search page (there had been some unresolved patterns)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3559 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent d59b31ec0c
commit a922d9444d

@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4
# Release Configuration
releaseVersion=0.512
releaseVersion=0.513
releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}

@ -29,7 +29,7 @@
<fieldset class="yacys">
<input id="search" name="search" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="Enter" type="submit" name="Enter" value="Search" /> &nbsp;
<a href="index.html?display=#[display]#&amp;searchoptions=1&amp;count=#[count]#&amp;order=#[order]#&amp;resource=#[resource]#&amp;time=#[time]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;type=#[type]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#">more options</a>
<a href="index.html?display=#[display]#&amp;input=#[input]#&amp;searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;time=#[time]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;type=#[type]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#">more options</a>
<div class="yacysearch">
<input type="radio" id="text" name="contentdom" value="text"#(contentdomCheckText)#:: checked="checked"#(/contentdomCheckText)# />
<label for="text">Text</label>&nbsp;&nbsp;
@ -44,7 +44,6 @@
</div>
<input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="count" value="#[count]#" />
<input type="hidden" name="order" value="#[order]#" />
<input type="hidden" name="resource" value="#[resource]#" />
<input type="hidden" name="time" value="#[time]#" />
<input type="hidden" name="urlmaskfilter" value="#[urlmaskfilter]#" />
@ -106,7 +105,7 @@ document.getElementById("Enter").value = "search again - catch up more links";
<p><strong>Refine your search with these topwords</strong>:</p>
<p>
#{words}#
<a href="yacysearch.html?search=#[newsearch]#&amp;Enter=Search&amp;count=#[count]#&amp;order=#[order]#&amp;resource=#[resource]#&amp;time=#[time]#">#[word]#</a>
<a href="yacysearch.html?search=#[newsearch]#&amp;Enter=Search&amp;count=#[count]#&amp;resource=#[resource]#&amp;time=#[time]#">#[word]#</a>
#{/words}#
</p>
#(/combine)#

@ -52,7 +52,6 @@ import java.net.MalformedURLException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.regex.PatternSyntaxException;
import java.util.TreeSet;
@ -92,7 +91,8 @@ public class yacysearch {
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
boolean authenticated = sb.adminAuthenticated(header) >= 2;
int display = ((post == null) || (!authenticated)) ? 0 : post.getInt("display", 0);
int display = (post == null) ? 0 : post.getInt("display", 0);
if ((display == 1) && (!authenticated)) display = 0;
int input = (post == null) ? 0 : post.getInt("input", 1);
String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", "");
if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P WEB SEARCH";
@ -120,7 +120,10 @@ public class yacysearch {
// we create empty entries for template strings
final serverObjects prop = new serverObjects();
prop.put("input", input);
prop.put("display", display);
prop.put("input_input", input);
prop.put("input_display", display);
prop.putASIS("input_promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("input_former", "");
prop.put("input_count", 10);
@ -144,7 +147,6 @@ public class yacysearch {
prop.put("input_contentdomCheckVideo", 0);
prop.put("input_contentdomCheckImage", 0);
prop.put("input_contentdomCheckApp", 0);
prop.put("input", 0);
return prop;
}
@ -255,7 +257,6 @@ public class yacysearch {
final boolean globalsearch = (global) && (yacyonline) && (!samesearch);
// do the search
Set querywords = query[0];
plasmaSearchQuery thisSearch = new plasmaSearchQuery(
querystring,
plasmaCondenser.words2hashes(query[0]),
@ -317,7 +318,7 @@ public class yacysearch {
prop.put("type_results_" + i + "_ybr", plasmaSearchPreOrder.ybr(result.getUrlentry().hash()));
prop.put("type_results_" + i + "_size", Long.toString(result.getUrlentry().size()));
try {
prop.put("type_results_" + i + "_words", URLEncoder.encode(querywords.toString(),"UTF-8"));
prop.put("type_results_" + i + "_words", URLEncoder.encode(query[0].toString(),"UTF-8"));
} catch (UnsupportedEncodingException e) {}
prop.put("type_results_" + i + "_former", results.getFormerSearch());
prop.put("type_results_" + i + "_rankingprops", result.getUrlentry().word().toPropertyForm() + ", domLengthEstimated=" + plasmaURL.domLengthEstimation(result.getUrlhash()) +
@ -439,10 +440,10 @@ public class yacysearch {
}
}
prop.put("type", (thisSearch.contentdom == plasmaSearchQuery.CONTENTDOM_TEXT) ? 0 : ((thisSearch.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) ? 2 : 1));
prop.put("input_type", (thisSearch.contentdom == plasmaSearchQuery.CONTENTDOM_TEXT) ? 0 : ((thisSearch.contentdom == plasmaSearchQuery.CONTENTDOM_IMAGE) ? 2 : 1));
if (prop.getInt("type", 0) == 1) prop.put("type_mediatype", contentdomString);
prop.put("cat", "href");
prop.put("depth", "0");
prop.put("input_cat", "href");
prop.put("input_depth", "0");
// adding some additional properties needed for the rss feed
String hostName = (String) header.get("Host", "localhost");
@ -478,9 +479,9 @@ public class yacysearch {
}
prop.put("type_results", line);
prop.put("type", 3); // set type of result: image list
prop.put("cat", "href");
prop.put("depth", depth);
prop.put("input_type", 3); // set type of result: image list
prop.put("input_cat", "href");
prop.put("input_depth", depth);
}
// if user is not authenticated, he may not vote for URLs
@ -488,7 +489,10 @@ public class yacysearch {
for (int i=0; i<linkcount; i++)
prop.put("type_results_" + i + "_authorized", (authenticated) ? 1 : 0);
prop.put("input", input);
prop.put("display", display);
prop.put("input_input", input);
prop.put("input_display", display);
prop.putASIS("input_promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("input_former", post.get("search", ""));
prop.put("input_count", count);
@ -504,7 +508,7 @@ public class yacysearch {
prop.put("input_contentdomCheckVideo", (contentdomCode == plasmaSearchQuery.CONTENTDOM_VIDEO) ? 1 : 0);
prop.put("input_contentdomCheckImage", (contentdomCode == plasmaSearchQuery.CONTENTDOM_IMAGE) ? 1 : 0);
prop.put("input_contentdomCheckApp", (contentdomCode == plasmaSearchQuery.CONTENTDOM_APP) ? 1 : 0);
prop.put("input", input);
// return rewrite properties
return prop;

Loading…
Cancel
Save