diff --git a/out/out.Search.php b/out/out.Search.php index 59f494821..d4a0391e2 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -230,7 +230,9 @@ if($fullsearch) { $index = $fulltextservice->Indexer(); if($index) { if(!empty($settings->_suggestTerms) && !empty($_GET['query'])) { - $terms = $index->terms($_GET['query'], $settings->_suggestTerms); + $st = preg_split("/[\s,]+/", trim($_GET['query'])); + if($lastterm = end($st)) + $terms = $index->terms($lastterm, $settings->_suggestTerms); } $lucenesearch = $fulltextservice->Search(); $searchresult = $lucenesearch->search($query, array('record_type'=>$record_type, 'owner'=>$ownernames, 'status'=>$status, 'category'=>$categorynames, 'user'=>$user->isAdmin() ? [] : [$user->getLogin()], 'mimetype'=>$mimetype, 'startFolder'=>$startFolder, 'rootFolder'=>$rootFolder, 'created_start'=>$createstartts, 'created_end'=>$createendts, 'attributes'=>$attributes), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1))));