56 if(self::$instance == null)
71 'crs' => array(
'filter' =>
'type:crs',
'trans' =>
'objs_crs'),
72 'grp' => array(
'filter' =>
'type:grp',
'trans' =>
'objs_grp'),
73 'lms' => array(
'filter' =>
'type:lm OR type:htlm OR type:sahs OR type:dbk',
'trans' =>
'learning_resource'),
74 'glo' => array(
'filter' =>
'type:glo',
'trans' =>
'objs_glo'),
75 'mep' => array(
'filter' =>
'type:mep',
'trans' =>
'objs_mep'),
76 'tst' => array(
'filter' =>
'type:tst OR type:svy OR type:qpl OR type:spl',
'trans' =>
'search_tst_svy'),
77 'frm' => array(
'filter' =>
'type:frm',
'trans' =>
'objs_frm'),
78 'exc' => array(
'filter' =>
'type:exc',
'trans' =>
'objs_exc'),
79 'file' => array(
'filter' =>
'type:file',
'trans' =>
'objs_file'),
80 'mcst' => array(
'filter' =>
'type:mcst',
'trans' =>
'objs_mcst'),
81 'wiki' => array(
'filter' =>
'type:wiki',
'trans' =>
'objs_wiki')
99 foreach(self::getLuceneItemFilterDefinitions() as $obj => $def)
101 if(isset($filter[$obj]) and $filter[$obj])
103 $enabled[$obj] = $def;
118 static $seas_ref_id = 0;
124 $query =
"SELECT object_reference.ref_id as ref_id FROM object_reference,tree,object_data ".
125 "WHERE tree.parent = ".$ilDB->quote(SYSTEM_FOLDER_ID,
'integer').
" ".
126 "AND object_data.type = 'seas' ".
127 "AND object_reference.ref_id = tree.child ".
128 "AND object_reference.obj_id = object_data.obj_id";
133 return $seas_ref_id =
$row->ref_id;
140 if($ilDB->getDBType() ==
'oracle')
144 return $this->index ?
true :
false;
148 $this->index = $a_status;
152 return $this->lucene ?
true :
false;
156 $this->lucene = $a_status ?
true :
false;
165 $this->max_hits = $a_max_hits;
176 $this->default_operator = $a_op;
181 $this->fragmentSize = $a_size;
191 $this->fragmentCount = $a_count;
196 return $this->hide_adv_search ?
true :
false;
200 $this->hide_adv_search = $a_status;
204 return $this->auto_complete_length;
208 $this->auto_complete_length = $auto_complete_length;
218 $this->numSubitems = $a_max;
238 return $this->last_index_date instanceof
ilDateTime ?
239 $this->last_index_date :
245 $this->lucene_item_filter_enabled = $a_status;
260 $this->lucene_item_filter = $a_filter;
268 $this->last_index_date = $time;
275 $this->ilias->setSetting(
'search_max_hits',$this->
getMaxHits());
276 $this->ilias->setSetting(
'search_index',(
int) $this->
enabledIndex());
277 $this->ilias->setSetting(
'search_lucene',(
int) $this->
enabledLucene());
280 $this->ilias->setSetting(
'lucene_fragment_size',$this->
getFragmentSize());
281 $this->ilias->setSetting(
'lucene_fragment_count',$this->
getFragmentCount());
282 $this->ilias->setSetting(
'lucene_max_subitems',$this->
getMaxSubitems());
296 $this->
setMaxHits($this->ilias->getSetting(
'search_max_hits',10));
297 $this->
enableIndex($this->ilias->getSetting(
'search_index',0));
298 $this->
enableLucene($this->ilias->getSetting(
'search_lucene',0));
300 $this->
setDefaultOperator($this->ilias->getSetting(
'lucene_default_operator',self::OPERATOR_AND));
301 $this->
setFragmentSize($this->ilias->getSetting(
'lucene_fragment_size',50));
302 $this->
setFragmentCount($this->ilias->getSetting(
'lucene_fragment_count',3));
303 $this->
setMaxSubitems($this->ilias->getSetting(
'lucene_max_subitems',5));
304 $this->
showRelevance($this->ilias->getSetting(
'lucene_show_relevance',
true));
306 if($time = $this->ilias->getSetting(
'lucene_last_index_time',
false))
318 $this->
enableLuceneItemFilter($this->ilias->getSetting(
'lucene_item_filter_enabled',(
int) $this->isLuceneItemFilterEnabled()));
320 $filter = $this->ilias->getSetting(
'lucene_item_filter',serialize($this->
getLuceneItemFilter()));