add new config var suggestTerms

This commit is contained in:
Uwe Steinmann 2023-04-21 13:02:42 +02:00
parent 3d4a63f335
commit 66ecc57780
3 changed files with 7 additions and 0 deletions

View File

@ -132,6 +132,8 @@ class Settings { /* {{{ */
var $_fullSearchEngine = 'lucene';
// default search method
var $_defaultSearchMethod = 'database'; // or 'fulltext'
// suggest search term
var $_suggestTerms = array(); // or 'all', 'title'
// jump straight to the document if it is the only hit of a search
var $_showSingleSearchHit = true;
// contentOffsetDirTo
@ -532,6 +534,8 @@ class Settings { /* {{{ */
$this->_maxSizeForFullText = intval($tab["maxSizeForFullText"]);
$this->_fullSearchEngine = strval($tab["fullSearchEngine"]);
$this->_defaultSearchMethod = strval($tab["defaultSearchMethod"]);
if(trim(strval($tab["suggestTerms"])))
$this->_suggestTerms = explode(',',strval($tab["suggestTerms"]));
$this->_showSingleSearchHit = Settings::boolVal($tab["showSingleSearchHit"]);
$this->_stopWordsFile = strval($tab["stopWordsFile"]);
$this->_sortUsersInList = strval($tab["sortUsersInList"]);
@ -914,6 +918,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "maxSizeForFullText", $this->_maxSizeForFullText);
$this->setXMLAttributValue($node, "fullSearchEngine", $this->_fullSearchEngine);
$this->setXMLAttributValue($node, "defaultSearchMethod", $this->_defaultSearchMethod);
$this->setXMLAttributValue($node, "suggestTerms", implode(',', $this->_suggestTerms));
$this->setXMLAttributValue($node, "showSingleSearchHit", $this->_showSingleSearchHit);
$this->setXMLAttributValue($node, "expandFolderTree", $this->_expandFolderTree);
$this->setXMLAttributValue($node, "stopWordsFile", $this->_stopWordsFile);

View File

@ -133,6 +133,7 @@ if ($action == "saveSettings")
setIntValue('maxSizeForFullText');
setStrValue('fullSearchEngine');
setStrValue('defaultSearchMethod');
setStrValue('suggestTerms');
setBoolValue("showSingleSearchHit");
setBoolValue("enableSessionList");
setBoolValue("enableClipboard");

View File

@ -358,6 +358,7 @@ if(($kkk = $this->callHook('getFullSearchEngine')) && is_array($kkk))
<?php $this->showConfigOption('settings_fullSearchEngine', 'fullSearchEngine', $fullsearchengines, false, true); ?>
<?php $this->showConfigOption('settings_defaultSearchMethod', 'defaultSearchMethod', array('database'=>'settings_defaultSearchMethod_valdatabase', 'fulltext'=>'settings_defaultSearchMethod_valfulltext'), false, true); ?>
<?php $this->showConfigCheckbox('settings_showSingleSearchHit', 'showSingleSearchHit'); ?>
<?php $this->showConfigOption('settings_suggestTerms', 'suggestTerms', array('title','comment', 'keywords'), true, true); ?>
<?php $this->showConfigText('settings_stopWordsFile', 'stopWordsFile'); ?>
<?php $this->showConfigCheckbox('settings_enableClipboard', 'enableClipboard'); ?>
<?php $this->showConfigCheckbox('settings_enableMenuTasks', 'enableMenuTasks'); ?>