Skip to content

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

- reduced default search time - this can be configured using the network definition file

orbiter5185acaf41cc
diff --git a/htroot/index.html b/htroot/index.html
index d3960e2e9..0a13b3fa8 100644
--- a/htroot/index.html
+++ b/htroot/index.html
@@ -31,14 +31,14 @@
<input type="radio" id="audio" name="contentdom" value="audio" #(contentdomCheckAudio)#::checked="checked"#(/contentdomCheckAudio)# /><label for="audio">Audio</label>&nbsp;&nbsp;
<input type="radio" id="video" name="contentdom" value="video" #(contentdomCheckVideo)#::checked="checked"#(/contentdomCheckVideo)# /><label for="video">Video</label>&nbsp;&nbsp;
<input type="radio" id="app" name="contentdom" value="app" #(contentdomCheckApp)#::checked="checked"#(/contentdomCheckApp)# /><label for="app">Applications</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
- #(searchoptions)#<!-- default values are hard-coded
+ #(searchoptions)#
<input type="hidden" name="count" value="10" />
<input type="hidden" name="offset" value="0" />
<input type="hidden" name="resource" value="global" />
- <input type="hidden" name="time" value="6" />
+ <input type="hidden" name="time" value="#[searchtime]#" />
<input type="hidden" name="urlmaskfilter" value=".*" />
<input type="hidden" name="prefermaskfilter" value="" />
- <input type="hidden" name="indexof" value="off" />-->
+ <input type="hidden" name="indexof" value="off" />
</fieldset>
<p><a href="/index.html?searchoptions=1&amp;display=#[display]#" onclick="this.href='/index.html?searchoptions=1&amp;display=#[display]#&amp;former='+document.getElementById('searchform').search.value+'&amp;contentdom='+radioValue(document.getElementById('searchform').contentdom)">more options...</a></p>
::
@@ -77,6 +77,7 @@
<select id="time" name="time">
<option #(time-1)#::selected="selected"#(/time-1)#>1</option>
<option #(time-2)#::selected="selected"#(/time-2)#>2</option>
+ <option #(time-3)#::selected="selected"#(/time-3)#>3</option>
<option #(time-4)#::selected="selected"#(/time-4)#>4</option>
<option #(time-6)#::selected="selected"#(/time-6)#>6</option>
<option #(time-8)#::selected="selected"#(/time-8)#>8</option>
diff --git a/htroot/index.java b/htroot/index.java
index 9cea0fe18..84b408a45 100644
--- a/htroot/index.java
+++ b/htroot/index.java
@@ -60,7 +60,7 @@ public class index {
final int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0);
final String former = (post == null) ? "" : post.get("former", "");
final int count = Math.min(100, (post == null) ? 10 : post.getInt("count", 10));
- final int time = Math.min(60, (post == null) ? 6 : post.getInt("time", 6));
+ final int time = Math.min(60, (post == null) ? (int) sb.getConfigLong("network.unit.search.time", 3) : post.getInt("time", (int) sb.getConfigLong("network.unit.search.time", 3)));
final String urlmaskfilter = (post == null) ? ".*" : post.get("urlmaskfilter", ".*");
final String prefermaskfilter = (post == null) ? "" : post.get("prefermaskfilter", "");
final String constraint = (post == null) ? null : post.get("constraint", null);
@@ -123,8 +123,10 @@ public class index {
prop.put("searchoptions_resource-global-disabled_reason",
(indexReceiveGranted) ? "0" : (indexDistributeGranted ? "1" : "2"));
prop.put("searchoptions_resource-local", global ? "0" : "1");
+ prop.put("searchoptions_searchtime", time);
prop.put("searchoptions_time-1", (time == 1) ? "1" : "0");
prop.put("searchoptions_time-2", (time == 2) ? "1" : "0");
+ prop.put("searchoptions_time-3", (time == 3) ? "1" : "0");
prop.put("searchoptions_time-4", (time == 4) ? "1" : "0");
prop.put("searchoptions_time-6", (time == 6) ? "1" : "0");
prop.put("searchoptions_time-8", (time == 8) ? "1" : "0");
diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java
index 0524cfcaf..93e12e69d 100644
--- a/htroot/yacysearch.java
+++ b/htroot/yacysearch.java
@@ -87,7 +87,7 @@ public class yacysearch {
// case if no values are requested
String querystring = (post == null) ? "" : post.get("search", "").trim();
- boolean rss = post.get("rss", "false").equals("true");
+ boolean rss = (post == null) ? false : post.get("rss", "false").equals("true");
if ((post == null) || (env == null) || (querystring.length() == 0) || (!searchAllowed)) {
/*
@@ -119,7 +119,7 @@ public class yacysearch {
prop.put("input_count", "10");
prop.put("input_offset", "0");
prop.put("input_resource", "global");
- prop.put("input_time", "6");
+ prop.put("input_time", sb.getConfigLong("network.unit.search.time", 3));
prop.put("input_urlmaskfilter", ".*");
prop.put("input_prefermaskfilter", "");
prop.put("input_indexof", "off");
@@ -153,7 +153,7 @@ public class yacysearch {
int offset = post.getInt("offset", 0);
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
final boolean indexof = post.get("indexof","").equals("on");
- final long searchtime = 1000 * post.getLong("time", 6);
+ final long searchtime = 1000 * post.getLong("time", (int) sb.getConfigLong("network.unit.search.time", 3));
String urlmask = "";
if (post.containsKey("urlmask") && post.get("urlmask").equals("no")) {
urlmask = ".*";
diff --git a/yacy.network.unit b/yacy.network.unit
index dbc640ef1..133a27102 100644
--- a/yacy.network.unit
+++ b/yacy.network.unit
@@ -52,6 +52,7 @@
network.unit.name = freeworld
network.unit.description = Public YaCy Community
network.unit.domain = global
+network.unit.search.time = 4
network.unit.dhtredundancy.junior = 1
network.unit.dhtredundancy.senior = 3
network.unit.bootstrap.seedlist0 = http://de.geocities.com/d15511z/yacy/angel/seed.txt