63 if(self::$instance == null)
78 'crs' => array(
'filter' =>
'type:crs',
'trans' =>
'objs_crs'),
79 'grp' => array(
'filter' =>
'type:grp',
'trans' =>
'objs_grp'),
80 'lms' => array(
'filter' =>
'type:lm OR type:htlm OR type:sahs OR type:dbk',
'trans' =>
'learning_resource'),
81 'glo' => array(
'filter' =>
'type:glo',
'trans' =>
'objs_glo'),
82 'mep' => array(
'filter' =>
'type:mep',
'trans' =>
'objs_mep'),
83 'tst' => array(
'filter' =>
'type:tst OR type:svy OR type:qpl OR type:spl',
'trans' =>
'search_tst_svy'),
84 'frm' => array(
'filter' =>
'type:frm',
'trans' =>
'objs_frm'),
85 'exc' => array(
'filter' =>
'type:exc',
'trans' =>
'objs_exc'),
86 'file' => array(
'filter' =>
'type:file',
'trans' =>
'objs_file'),
87 'mcst' => array(
'filter' =>
'type:mcst',
'trans' =>
'objs_mcst'),
88 'wiki' => array(
'filter' =>
'type:wiki',
'trans' =>
'objs_wiki')
95 'pdf' => array(
'filter' =>
'mimeType:pdf',
'trans' =>
'search_mime_pdf'),
96 'word' => array(
'filter' =>
'mimeType:word',
'trans' =>
'search_mime_word'),
97 'excel' => array(
'filter' =>
'mimeType:excel',
'trans' =>
'search_mime_excel'),
98 'powerpoint' => array(
'filter' =>
'mimeType:powerpoint',
'trans' =>
'search_mime_powerpoint'),
99 'image' => array(
'filter' =>
'mimeType:image',
'trans' =>
'search_mime_image')
117 foreach(self::getLuceneItemFilterDefinitions() as $obj => $def)
119 if(isset($filter[$obj]) and $filter[$obj])
121 $enabled[$obj] = $def;
137 foreach(self::getLuceneMimeFilterDefinitions() as $mime => $def)
139 if(isset($filter[$mime]) and $filter[$mime])
141 $enabled[$mime] = $def;
149 $this->prefix_wildcard = $a_stat;
168 static $seas_ref_id = 0;
174 $query =
"SELECT object_reference.ref_id as ref_id FROM object_reference,tree,object_data ".
175 "WHERE tree.parent = ".$ilDB->quote(SYSTEM_FOLDER_ID,
'integer').
" ".
176 "AND object_data.type = 'seas' ".
177 "AND object_reference.ref_id = tree.child ".
178 "AND object_reference.obj_id = object_data.obj_id";
183 return $seas_ref_id =
$row->ref_id;
190 if($ilDB->getDBType() ==
'oracle')
194 return $this->index ?
true :
false;
198 $this->index = $a_status;
202 return $this->lucene ?
true :
false;
206 $this->lucene = $a_status ?
true :
false;
215 $this->max_hits = $a_max_hits;
225 $this->default_operator = $a_op;
230 $this->fragmentSize = $a_size;
240 $this->fragmentCount = $a_count;
245 return $this->hide_adv_search ?
true :
false;
249 $this->hide_adv_search = $a_status;
267 $this->numSubitems = $a_max;
287 return $this->last_index_date instanceof
ilDateTime ?
288 $this->last_index_date :
294 $this->lucene_item_filter_enabled = $a_status;
310 $this->lucene_item_filter = $a_filter;
315 $this->lucene_offline_filter = $a_stat;
336 $this->lucene_mime_filter = $a_filter;
358 $this->lucene_mime_filter_enabled = $a_stat;
367 $this->last_index_date = $time;
385 $this->user_search = $a_status;
392 $this->ilias->setSetting(
'search_max_hits',$this->
getMaxHits());
393 $this->ilias->setSetting(
'search_index',(
int) $this->
enabledIndex());
394 $this->ilias->setSetting(
'search_lucene',(
int) $this->
enabledLucene());
397 $this->ilias->setSetting(
'lucene_fragment_size',$this->
getFragmentSize());
398 $this->ilias->setSetting(
'lucene_fragment_count',$this->
getFragmentCount());
399 $this->ilias->setSetting(
'lucene_max_subitems',$this->
getMaxSubitems());
421 $this->
setMaxHits($this->ilias->getSetting(
'search_max_hits',10));
422 $this->
enableIndex($this->ilias->getSetting(
'search_index',0));
423 $this->
enableLucene($this->ilias->getSetting(
'search_lucene',0));
425 $this->
setDefaultOperator($this->ilias->getSetting(
'lucene_default_operator',self::OPERATOR_AND));
426 $this->
setFragmentSize($this->ilias->getSetting(
'lucene_fragment_size',50));
427 $this->
setFragmentCount($this->ilias->getSetting(
'lucene_fragment_count',3));
428 $this->
setMaxSubitems($this->ilias->getSetting(
'lucene_max_subitems',5));
429 $this->
showRelevance($this->ilias->getSetting(
'lucene_show_relevance',
true));
431 if($time = $this->ilias->getSetting(
'lucene_last_index_time',
false))
441 $this->
setAutoCompleteLength($this->ilias->getSetting(
'auto_complete_length',$this->getAutoCompleteLength()));
443 $this->
enableLuceneItemFilter($this->ilias->getSetting(
'lucene_item_filter_enabled',(
int) $this->isLuceneItemFilterEnabled()));
445 $filter = $this->ilias->getSetting(
'lucene_item_filter',serialize($this->
getLuceneItemFilter()));
449 $this->
enableLuceneMimeFilter($ilSetting->get(
'lucene_mime_filter_enabled',$this->lucene_item_filter_enabled));
450 $filter = $this->ilias->getSetting(
'lucene_mime_filter',serialize($this->
getLuceneMimeFilter()));
452 $this->
showSubRelevance($this->ilias->getSetting(
'lucene_sub_relevance',$this->showSubRelevance));