doc/search: do not search with less than 3 chars

Please consider this a quickfix to avoid mass results while typing in
the global search field. We need farther improvements here:
* compact mode: e.g. title/first match on one row
* show a hint when less than 3 chars have been provided
* allow two chars once we fixed the above
This commit is contained in:
Thomas Gelf 2015-03-13 08:52:54 +01:00
parent a3f2d7de7e
commit 6bf8849d98
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@ class Doc_SearchController extends DocController
)
);
$search->setUrl('doc/icingaweb/chapter');
if (strlen($this->params->get('q')) < 3) {
$this->view->searches = array();
return;
}
$searches = array(
'Icinga Web 2' => $search
);