4 include_once
'Services/Search/classes/class.ilSearchSettings.php';
18 include_once
'./Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
22 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
27 $res = $searcher->getResult()->getCandidates();
36 foreach(
$res as $res_obj_id)
38 if(self::checkObjectPermission($res_obj_id))
43 if($num_entries >= $max_entries)
51 foreach($list as $entry)
57 include_once
'./Services/JSON/classes/class.ilJsonUtil.php';
70 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
77 $a_str = str_replace(
'"',
"", $a_str);
81 $object_types = array(
'cat',
'dbk',
'crs',
'fold',
'frm',
'grp',
'lm',
'sahs',
'glo',
'mep',
'htlm',
'exc',
'file',
'qpl',
'tst',
'svy',
'spl',
82 'chat',
'icrs',
'icla',
'webr',
'mcst',
'sess',
'pg',
'st',
'gdf',
'wiki');
84 $set = $ilDB->query(
"SELECT title, obj_id FROM object_data WHERE "
85 .$ilDB->like(
'title',
'text', $a_str.
"%").
" AND "
86 .$ilDB->in(
'type', $object_types,
false,
'text').
" ORDER BY title");
87 $max = ($settings->getAutoCompleteLength() > 0)
88 ? $settings->getAutoCompleteLength()
95 while (($rec = $ilDB->fetchAssoc($set)) && $cnt < $max)
97 if (strpos($rec[
"title"],
" ") > 0 || strpos($rec[
"title"],
"-") > 0)
99 $rec[
"title"] =
'"'.$rec[
"title"].
'"';
101 if (!in_array($rec[
"title"], $list) && !in_array($rec[
"obj_id"], $checked))
105 $list[] = $lim.$rec[
"title"];
108 $checked[] = $rec[
"obj_id"];
112 $set = $ilDB->query(
"SELECT rbac_id,obj_id,obj_type, keyword FROM il_meta_keyword WHERE "
113 .$ilDB->like(
'keyword',
'text', $a_str.
"%").
" AND "
114 .$ilDB->in(
'obj_type', $object_types,
false,
'text').
" ORDER BY keyword");
115 while (($rec = $ilDB->fetchAssoc($set)) && $cnt < $max)
117 if (strpos($rec[
"keyword"],
" ") > 0)
119 $rec[
"keyword"] =
'"'.$rec[
"keyword"].
'"';
121 if (!in_array($rec[
"keyword"], $list) && !in_array($rec[
"rbac_id"], $checked))
125 $list[] = $lim.$rec[
"keyword"];
129 $checked[] = $rec[
"rbac_id"];
134 foreach ($list as $l)
141 include_once
'./Services/JSON/classes/class.ilJsonUtil.php';
153 foreach ($refs as $ref)
155 if ($ilAccess->checkAccess(
"read",
"", $ref))