3 declare(strict_types=1);
55 $this->
ilias = $DIC[
'ilias'];
56 $this->setting = $DIC->settings();
63 return self::$instance;
65 return self::$instance =
new ilSearchSettings();
75 'crs' => array(
'filter' =>
'type:crs',
'trans' =>
'objs_crs'),
76 'grp' => array(
'filter' =>
'type:grp',
'trans' =>
'objs_grp'),
77 'lms' => array(
'filter' =>
'type:lm OR type:htlm',
'trans' =>
'obj_lrss'),
78 'glo' => array(
'filter' =>
'type:glo',
'trans' =>
'objs_glo'),
79 'mep' => array(
'filter' =>
'type:mep',
'trans' =>
'objs_mep'),
80 'tst' => array(
'filter' =>
'type:tst OR type:svy OR type:qpl OR type:spl',
'trans' =>
'search_tst_svy'),
81 'frm' => array(
'filter' =>
'type:frm',
'trans' =>
'objs_frm'),
82 'exc' => array(
'filter' =>
'type:exc',
'trans' =>
'objs_exc'),
83 'file' => array(
'filter' =>
'type:file',
'trans' =>
'objs_file'),
84 'mcst' => array(
'filter' =>
'type:mcst',
'trans' =>
'objs_mcst'),
85 'wiki' => array(
'filter' =>
'type:wiki',
'trans' =>
'objs_wiki'),
86 'copa' => array(
'filter' =>
'type:copa',
'trans' =>
'objs_copa'),
93 'pdf' => array(
'filter' =>
'mimeType:pdf',
'trans' =>
'search_mime_pdf'),
94 'word' => array(
'filter' =>
'mimeType:word',
'trans' =>
'search_mime_word'),
95 'excel' => array(
'filter' =>
'mimeType:excel',
'trans' =>
'search_mime_excel'),
96 'powerpoint' => array(
'filter' =>
'mimeType:powerpoint',
'trans' =>
'search_mime_powerpoint'),
97 'image' => array(
'filter' =>
'mimeType:image',
'trans' =>
'search_mime_image')
113 foreach (self::getLuceneItemFilterDefinitions() as $obj => $def) {
114 if (isset($filter[$obj]) and $filter[$obj]) {
130 foreach (self::getLuceneMimeFilterDefinitions() as $mime => $def) {
131 if (isset($filter[$mime]) and $filter[$mime]) {
140 $this->prefix_wildcard = $a_stat;
155 $ilDB = $DIC->database();
157 static $seas_ref_id = 0;
162 $query =
"SELECT object_reference.ref_id as ref_id FROM object_reference,tree,object_data " .
164 "AND object_data.type = 'seas' " .
165 "AND object_reference.ref_id = tree.child " .
166 "AND object_reference.obj_id = object_data.obj_id";
171 return $seas_ref_id = (
int) $row->ref_id;
180 $this->lucene = $a_status;
189 $this->max_hits = $a_max_hits;
199 $this->default_operator = $a_op;
204 $this->fragmentSize = $a_size;
214 $this->fragmentCount = $a_count;
223 $this->hide_adv_search = $a_status;
241 $this->numSubitems = $a_max;
261 return $this->last_index_date instanceof
ilDateTime ?
262 $this->last_index_date :
268 $this->lucene_item_filter_enabled = $a_status;
284 $this->lucene_item_filter = $a_filter;
289 $this->lucene_offline_filter = $a_stat;
310 $this->lucene_mime_filter = $a_filter;
328 $this->lucene_mime_filter_enabled = $a_stat;
334 $this->last_index_date = $time;
351 $this->user_search = $a_status;
359 $this->show_inactiv_user = $a_visible;
376 $this->show_limited_user = $a_visible;
392 $this->date_filter = $a_filter;
397 $this->setting->set(
'search_max_hits', (
string) $this->
getMaxHits());
398 $this->setting->set(
'search_lucene', (
string) $this->
enabledLucene());
401 $this->setting->set(
'lucene_fragment_size', (
string) $this->
getFragmentSize());
402 $this->setting->set(
'lucene_fragment_count', (
string) $this->
getFragmentCount());
403 $this->setting->set(
'lucene_max_subitems', (
string) $this->
getMaxSubitems());
424 $this->
setMaxHits((
int) $this->setting->get(
'search_max_hits',
'10'));
425 $this->
enableLucene((
bool) $this->setting->get(
'search_lucene',
'0'));
426 $this->
setDefaultOperator((
int) $this->setting->get(
'lucene_default_operator', (
string) self::OPERATOR_AND));
427 $this->
setFragmentSize((
int) $this->setting->get(
'lucene_fragment_size',
"50"));
428 $this->
setFragmentCount((
int) $this->setting->get(
'lucene_fragment_count',
"3"));
429 $this->
setMaxSubitems((
int) $this->setting->get(
'lucene_max_subitems',
"5"));
430 $this->
showRelevance((
bool) $this->setting->get(
'lucene_show_relevance',
"1"));
431 if ($time = $this->setting->get(
'lucene_last_index_time',
'0')) {
437 $this->
setAutoCompleteLength((
int) $this->setting->get(
'auto_complete_length', (
string) $this->getAutoCompleteLength()));
438 $this->
enableLuceneItemFilter((
bool) $this->setting->get(
'lucene_item_filter_enabled', (
string) $this->isLuceneItemFilterEnabled()));
439 $filter = (string) $this->setting->get(
'lucene_item_filter', serialize($this->
getLuceneItemFilter()));
441 $this->
enableLuceneOfflineFilter((
bool) $this->setting->get(
'lucene_offline_filter', (
string) $this->isLuceneOfflineFilterEnabled()));
442 $this->
enableLuceneMimeFilter((
bool) $this->setting->get(
'lucene_mime_filter_enabled', (
string) $this->lucene_item_filter_enabled));
443 $filter = (string) $this->setting->get(
'lucene_mime_filter', serialize($this->
getLuceneMimeFilter()));
445 $this->
showSubRelevance((
bool) $this->setting->get(
'lucene_sub_relevance', (
string) $this->showSubRelevance));
447 $this->
enableLuceneUserSearch((
bool) $this->setting->get(
'lucene_user_search', (
string) $this->user_search));
448 $this->
showInactiveUser((
bool) $this->setting->get(
'search_show_inactiv_user', (
string) $this->show_inactiv_user));
449 $this->
showLimitedUser((
bool) $this->setting->get(
'search_show_limited_user', (
string) $this->show_limited_user));
450 $this->
enableDateFilter((
bool) $this->setting->get(
'search_date_filter', (
string) $this->date_filter));
showSubRelevance(bool $a_stat)
setHideAdvancedSearch(bool $a_status)
isLuceneMimeFilterEnabled()
Check if lucene mime filter is enabled.
setDefaultOperator(int $a_op)
int $auto_complete_length
static getLuceneItemFilterDefinitions()
Get lucene item filter definitions.
static ilSearchSettings $instance
Class ChatMainBarProvider .
isInactiveUserVisible()
are inactive user visible in user search
getEnabledLuceneItemFilterDefinitions()
Get lucene item filter definitions.
setLuceneItemFilter(array $a_filter)
showRelevance(bool $a_status)
ilDateTime $last_index_date
setMaxSubitems(int $a_max)
isLuceneItemFilterEnabled()
setLastIndexTime(?ilDateTime $time)
getEnabledLuceneMimeFilterDefinitions()
static getLuceneMimeFilterDefinitions()
setFragmentCount(int $a_count)
array $lucene_mime_filter
setLuceneMimeFilter(array $a_filter)
enablePrefixWildcardQuery(bool $a_stat)
bool $lucene_mime_filter_enabled
enableLuceneUserSearch(bool $a_status)
Enable lucene user search.
static _getSearchSettingRefId()
Read the ref_id of Search Settings object.
setAutoCompleteLength(int $auto_complete_length)
header include for all ilias files.
array $lucene_item_filter
enableLucene(bool $a_status)
bool $lucene_item_filter_enabled
showLimitedUser(bool $a_visible)
show user with limited access in user search
enableLuceneItemFilter(bool $a_status)
enableLuceneOfflineFilter(bool $a_stat)
setFragmentSize(int $a_size)
isLuceneUserSearchEnabled()
Check if user search is enabled.
enableDateFilter(bool $a_filter)
showInactiveUser(bool $a_visible)
show inactive user in user search
bool $lucene_offline_filter
isLuceneOfflineFilterEnabled()
enableLuceneMimeFilter(bool $a_stat)
setMaxHits(int $a_max_hits)
isPrefixWildcardQueryEnabled()