From 5e48d724acc07052be6e6a8f2d3a6917a3097cc5 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 9 Jan 2023 15:31:05 +0100 Subject: [PATCH] pass terms to view --- out/out.Search.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/out/out.Search.php b/out/out.Search.php index 51618c6bd..99cdb822d 100644 --- a/out/out.Search.php +++ b/out/out.Search.php @@ -66,6 +66,7 @@ if (isset($_GET["removecategory"]) && is_numeric($_GET["removecategory"]) && $_G $removecategory = (int) $_GET['removecategory']; } +$terms = []; $limit = (isset($_GET["limit"]) && is_numeric($_GET["limit"])) ? (int) $_GET['limit'] : 20; $fullsearch = ((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext') || !empty($_GET["fullsearch"])) && $settings->_enableFullSearch; if($fullsearch) { @@ -190,6 +191,7 @@ if($fullsearch) { $total = 0; $index = $fulltextservice->Indexer(); if($index) { +// $terms = $index->terms($_GET['query']); $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), ($pageNumber == 'all' ? array() : array('limit'=>$limit, 'offset'=>$limit * ($pageNumber-1)))); if($searchresult === false) { @@ -575,6 +577,7 @@ if($settings->_showSingleSearchHit && count($entries) == 1) { $view->setParam('changecategory', $changecategory); $view->setParam('removecategory', $removecategory); $view->setParam('searchhits', $entries); + $view->setParam('terms', $terms); $view->setParam('totalpages', $totalPages); $view->setParam('pagenumber', $pageNumber); $view->setParam('limit', $limit);