mirror of
https://github.com/humhub/humhub.git
synced 2025-01-18 06:38:14 +01:00
Show some search results, when no keyword was given
This commit is contained in:
parent
c07f747d4e
commit
c846a02193
@ -155,6 +155,7 @@ class ZendLuceneSearch extends Search
|
||||
\ZendSearch\Lucene\Search\Query\Wildcard::setMinPrefixLength(0);
|
||||
|
||||
$query = new \ZendSearch\Lucene\Search\Query\Boolean();
|
||||
|
||||
$emptyQuery = true;
|
||||
foreach (explode(" ", $keyword) as $k) {
|
||||
// Require a minimum of non-wildcard characters
|
||||
@ -165,8 +166,9 @@ class ZendLuceneSearch extends Search
|
||||
}
|
||||
}
|
||||
|
||||
// if no keywords or only too short keywords are given, the result is empty.
|
||||
if ($emptyQuery) {
|
||||
// if only too short keywords are given, the result is empty
|
||||
// when no keyword was given - show some results
|
||||
if ($emptyQuery && $keyword != '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user