fix (enable) error msg on empty query

This commit is contained in:
reger 2014-11-28 22:44:33 +01:00
parent ef5c5b4489
commit c475be2937
2 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@ Use the RSS search result format to add static searches to your RSS reader, if y
::
<p>No Results.</p>
::
<p>No Results. (length of search words must be at least 2 characters)</p>
<p>No Results. (length of search words must be at least 1 character)</p>
::
<div id="results"></div>
<div class="progress">

View File

@ -845,8 +845,8 @@ public class yacysearch {
prop.put("excluded", "0");
}
if ( prop == null || prop.isEmpty() ) {
if ( post.get("query", post.get("search", "")).length() < 2 ) {
if (prop.isEmpty() || querystring.length() == 0) {
if ( querystring.length() == 0 ) { // querystring is trimmed originalquerystring
prop.put("num-results", "2"); // no results - at least 2 chars
} else {
prop.put("num-results", "1"); // no results