11 include_once
'Services/Search/classes/class.ilAbstractSearch.php';
20 $this->
setFields(array(
'title',
'description'));
25 $this->search_result = $a_search_result_obect;
30 $this->filter_shop_topic_id = $a_topic_id;
43 $where = $this->__createWhereCondition();
46 $query =
"SELECT object_reference.ref_id, object_data.obj_id,object_data.type ".$locate.
"
48 INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
49 INNER JOIN object_data ON object_data.obj_id = object_reference.obj_id ";
52 $types = array_merge($types, $where[
'types']);
53 $values = array_merge($values, $where[
'values']);
56 $query .=
" GROUP BY object_reference.ref_id, object_data.obj_id,object_data.type,object_data.title,object_data.description";
57 $query .=
" ORDER BY object_data.obj_id DESC";
59 $statement = $this->db->queryf(
67 $this->search_result->addEntry(
$row->ref_id,
$row->type, $this->__prepareFound(
$row));
74 return ' AND ' . $this->db->in(
'type', $this->object_types,
false,
'text');
86 if($this->query_parser->getCombination() ==
'or')
91 if(!strlen($this->query_parser->getQueryString()))
98 if(count($this->
fields) > 1)
100 $tmp_fields = array();
101 foreach($this->
fields as $field)
103 $tmp_fields[] = array($field,
'text');
105 $complete_str = $ilDB->concat($tmp_fields);
109 $complete_str = $this->
fields[0];
113 foreach($this->query_parser->getQuotedWords() as $word)
116 $locate .= $ilDB->locate($ilDB->quote($word,
'text'), $complete_str, 1);
117 $locate .= (
' found'.$counter++);
126 if($this->query_parser->getCombination() ==
'or')
131 if(!strlen($this->query_parser->getQueryString()))
137 foreach($this->query_parser->getQuotedWords() as $word)
139 $res_found =
'found'.$counter++;
140 $found[] =
$row->$res_found;
142 return $found ? $found : array();