Skip to content

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

switch off real-time search if index is large

orbiterfeac494f26c5
diff --git a/htroot/yacyinteractive.html b/htroot/yacyinteractive.html
index 5e4b66f5f..f30fd34c2 100644
--- a/htroot/yacyinteractive.html
+++ b/htroot/yacyinteractive.html
@@ -56,7 +56,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
#%env/templates/simpleheader.template%#
#(/topmenu)#
<div>
-<form class="search small" id="searchform" action="yacyinteractive.html" method="get" onkeyup="xmlhttpPost(); return false;">
+<form class="search small" id="searchform" action="yacyinteractive.html" method="get" #(allowrealtime)#::onkeyup="xmlhttpPost(); return false;"::#(/allowrealtime)#>
<h2>#[promoteSearchPageGreeting]#</h2>
<div class="yacylogo">
<a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.smallImage]#" alt="yacysearch"/></a>
@@ -65,6 +65,9 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<input type="hidden" name="maximumRecords" value="#[maximumRecords]#" />
<input type="hidden" name="startRecord" value="#[startRecord]#" />
<input id="search" name="query" type="text" value="#[query]#" size="50" maxlength="80" />
+ #(allowrealtime)#
+ <input id="Enter" type="submit" name="Enter" value="Search" />::
+ #(/allowrealtime)#
</fieldset>
<!--<pre>Raw JSON String: <div id="raw"></div></pre>-->
</form>
diff --git a/htroot/yacyinteractive.java b/htroot/yacyinteractive.java
index 8eb797b45..647916f1d 100644
--- a/htroot/yacyinteractive.java
+++ b/htroot/yacyinteractive.java
@@ -54,6 +54,7 @@ public class yacyinteractive {
prop.putHTML("maximumRecords", maximumRecords);
prop.putHTML("querys", query.replaceAll(" ", "+"));
prop.put("serverlist", query.length() == 0 ? 1 : 0);
+ prop.put("allowrealtime", sb.indexSegments.URLCount() < 100000 ? 1 : 0);
return prop;
}
}
\ No newline at end of file