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) {
37 if (self::checkObjectPermission($res_obj_id)) {
41 if ($num_entries >= $max_entries) {
48 foreach (
$list as $entry) {
53 include_once
'./Services/JSON/classes/class.ilJsonUtil.php';
66 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
68 return self::getLuceneList($a_str);
72 $a_str = str_replace(
'"',
"", $a_str);
76 $object_types =
array(
'cat',
'dbk',
'crs',
'fold',
'frm',
'grp',
'lm',
'sahs',
'glo',
'mep',
'htlm',
'exc',
'file',
'qpl',
'tst',
'svy',
'spl',
77 'chat',
'webr',
'mcst',
'sess',
'pg',
'st',
'gdf',
'wiki');
79 $set = $ilDB->query(
"SELECT title, obj_id FROM object_data WHERE " 80 . $ilDB->like(
'title',
'text', $a_str .
"%") .
" AND " 81 . $ilDB->in(
'type', $object_types,
false,
'text') .
" ORDER BY title");
82 $max = ($settings->getAutoCompleteLength() > 0)
83 ? $settings->getAutoCompleteLength()
90 while (($rec = $ilDB->fetchAssoc($set)) && $cnt < $max) {
91 if (strpos($rec[
"title"],
" ") > 0 || strpos($rec[
"title"],
"-") > 0) {
92 $rec[
"title"] =
'"' . $rec[
"title"] .
'"';
94 if (!in_array($rec[
"title"],
$list) && !in_array($rec[
"obj_id"], $checked)) {
96 $list[] = $lim . $rec[
"title"];
99 $checked[] = $rec[
"obj_id"];
103 $set = $ilDB->query(
"SELECT rbac_id,obj_id,obj_type, keyword FROM il_meta_keyword WHERE " 104 . $ilDB->like(
'keyword',
'text', $a_str .
"%") .
" AND " 105 . $ilDB->in(
'obj_type', $object_types,
false,
'text') .
" ORDER BY keyword");
106 while (($rec = $ilDB->fetchAssoc($set)) && $cnt < $max) {
107 if (strpos($rec[
"keyword"],
" ") > 0) {
108 $rec[
"keyword"] =
'"' . $rec[
"keyword"] .
'"';
110 if (!in_array($rec[
"keyword"],
$list) && !in_array($rec[
"rbac_id"], $checked)) {
112 $list[] = $lim . $rec[
"keyword"];
116 $checked[] = $rec[
"rbac_id"];
127 include_once
'./Services/JSON/classes/class.ilJsonUtil.php';
139 foreach ($refs as $ref) {
140 if ($ilAccess->checkAccess(
"read",
"", $ref)) {
if(isset($_REQUEST['delete'])) $list
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
static getList($a_str)
Get completion list.
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
static getLuceneList($a_str)
Performs better than standard like search on huge installations.
static encode($mixed, $suppress_native=false)
foreach($_POST as $key=> $value) $res
Search Auto Completion Application Class.
Create styles array
The data for the language used.
static checkObjectPermission($a_obj_id)
Checks read permission on obj id.