24 include_once
'Services/Search/classes/class.ilAbstractSearch.php';
53 $this->search_result = $a_search_result_obect;
58 $this->filter_shop_topic_id = $a_topic_id;
67 $this->mode = $a_mode;
91 echo __METHOD__.
' no mode given';
104 return ' AND ' . $this->db->in(
'obj_type', $this->
getFilter(),
false,
'text');
116 $where = $this->__createContributeWhereCondition();
119 $query =
"SELECT object_reference.ref_id,rbac_id,il_meta_entity.obj_id,obj_type ".$locate.
"
121 INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
122 INNER JOIN il_meta_entity ON il_meta_entity.obj_id = object_reference.obj_id ";
124 $query .= $where[
'query'];
125 $types = array_merge($types, $where[
'types']);
126 $values = array_merge($values, $where[
'values']);
129 $query .=
" GROUP BY object_reference.ref_id,il_meta_entity.obj_id,rbac_id,obj_type,il_meta_entity.entity ";
131 $statement = $this->db->queryf(
139 $this->search_result->addEntry(
$row->ref_id,
$row->obj_type,$this->__prepareFound(
$row),
$row->obj_id);
153 $where = $this->__createKeywordWhereCondition();
156 $query =
"SELECT object_reference.ref_id,rbac_id,il_meta_keyword.obj_id,obj_type ".$locate.
"
158 INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
159 INNER JOIN il_meta_keyword ON il_meta_keyword.obj_id = object_reference.obj_id ";
161 $query .= $where[
'query'];
162 $types = array_merge($types, $where[
'types']);
163 $values = array_merge($values, $where[
'values']);
166 $query .=
" GROUP BY object_reference.ref_id,il_meta_keyword.obj_id,rbac_id,obj_type,il_meta_keyword.keyword ";
168 $statement = $this->db->queryf(
176 $this->search_result->addEntry(
$row->ref_id,
$row->obj_type,$this->__prepareFound(
$row),
$row->obj_id);
190 $where = $this->__createTitleWhereCondition();
193 $query =
"SELECT object_reference.ref_id,rbac_id,il_meta_general.obj_id,obj_type ".$locate.
"
195 INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
196 INNER JOIN il_meta_general ON il_meta_general.obj_id = object_reference.obj_id ";
198 $query .= $where[
'query'];
199 $types = array_merge($types, $where[
'types']);
200 $values = array_merge($values, $where[
'values']);
203 $query .=
" GROUP BY object_reference.ref_id,il_meta_general.obj_id,rbac_id,obj_type,il_meta_general.title ";
205 $statement = $this->db->queryf(
213 $this->search_result->addEntry(
$row->ref_id,
$row->obj_type,$this->__prepareFound(
$row),
$row->obj_id);
227 $where = $this->__createDescriptionWhereCondition();
230 $query =
"SELECT object_reference.ref_id,rbac_id,il_meta_description.obj_id,obj_type ".$locate.
"
232 INNER JOIN object_reference ON object_reference.ref_id = payment_objects.ref_id
233 INNER JOIN il_meta_description ON il_meta_description.obj_id = object_reference.obj_id ";
235 $query .= $where[
'query'];
236 $types = array_merge($types, $where[
'types']);
237 $values = array_merge($values, $where[
'values']);
240 $query .=
" GROUP BY object_reference.ref_id,il_meta_description.obj_id,rbac_id,obj_type,il_meta_description.description ";
242 $statement = $this->db->queryf(
250 $this->search_result->addEntry(
$row->ref_id,
$row->obj_type,$this->__prepareFound(
$row),
$row->obj_id);
265 if($this->query_parser->getCombination() ==
'or')
270 if(!strlen($this->query_parser->getQueryString()))
277 if(count($this->fields) > 1)
279 $tmp_fields = array();
280 foreach($this->fields as $field)
282 $tmp_fields[] = array($field,
'text');
284 $complete_str = $ilDB->concat($tmp_fields);
288 $complete_str = $this->fields[0];
292 foreach($this->query_parser->getQuotedWords() as $word)
295 $locate .= $ilDB->locate($ilDB->quote($word,
'text'), $complete_str, 1);
296 $locate .= (
' found'.$counter++);
305 if($this->query_parser->getCombination() ==
'or')
310 if(!strlen($this->query_parser->getQueryString()))
316 foreach($this->query_parser->getQuotedWords() as $word)
318 $res_found =
'found'.$counter++;
319 $found[] =
$row->$res_found;
321 return $found ? $found : array();