35 public $object_types = array(
'cat',
'dbk',
'crs',
'fold',
'frm',
'grp',
'lm',
'sahs',
'glo',
'mep',
'htlm',
'exc',
'file',
'qpl',
'tst',
'svy',
'spl',
36 'chat',
'webr',
'mcst',
'sess',
'pg',
'st',
'wiki',
'book',
'copa');
51 $this->query_parser = $qp_obj;
54 include_once
'Services/Search/classes/class.ilSearchResult.php';
86 if (is_array($a_filter)) {
87 $this->object_types = $a_filter;
98 $this->id_filter = $a_id_filter;
117 if (is_array($this->object_types)) {
118 if (in_array(
$a_type, $this->object_types)) {
122 $this->object_types[] =
$a_type;
135 return $this->object_types ? $this->object_types : array();
147 $ilDB = $DIC[
'ilDB'];
149 if ($this->query_parser->getCombination() ==
'or') {
152 if (count($this->
fields) > 1) {
153 foreach ($this->
fields as $field) {
154 $tmp_fields[] = array($field,
'text');
156 $complete_str =
$ilDB->concat($tmp_fields);
164 $complete_str = $this->
fields[0];
168 foreach ($this->query_parser->getQuotedWords() as $word) {
170 $locate .=
$ilDB->locate(
$ilDB->quote($word,
'text'), $complete_str);
171 $locate .= (
' found' . $counter++);
173 #$locate .= (", LOCATE('".$word."',".$complete_str.") "); 174 #$locate .= ("as found".$counter++." "); 182 if ($this->query_parser->getCombination() ==
'or') {
186 foreach ($this->query_parser->getQuotedWords() as $word) {
187 $res_found =
"found" . $counter++;
188 $found[] =
$row->$res_found;
190 return $found ? $found : array();
195 echo "Should be overwritten.";
getFields()
Get fields to search.
__construct($qp_obj)
Constructor public.
__createLocateString()
build locate string in case of AND search
setIdFilter($a_id_filter)
Set id filter Filters search by given object id.
setFilter($a_filter)
set object type to search in
setFields($a_fields)
Set fields to search.
getFilter()
get object type to search in
getIdFilter()
Get Id filter.
appendToFilter($a_type)
Append object type to filter.