35 define(
'QP_COMBINATION_AND',
'and');
36 define(
'QP_COMBINATION_OR',
'or');
61 define(MIN_WORD_LENGTH,3);
65 $this->query_str = $a_query_str;
68 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
84 if(!$a_force and $this->settings->enabledIndex() and $a_length < 3)
86 $GLOBALS[
'ilLog']->write(__METHOD__.
': Disabled min word length');
89 $this->min_word_length = $a_length;
101 $a_value = (int)$a_value;
107 $this->global_min_length = $a_value;
117 $this->wildcards_allowed = (bool)$a_value;
127 $this->message = $a_msg;
137 $this->message .=
'<br />';
139 $this->message .= $a_msg;
144 $this->combination = $a_combination;
153 return trim($this->query_str);
157 return $this->words ? $this->words : array();
164 return $this->quoted_words ? $this->quoted_words : array();
168 foreach($this->quoted_words as $word)
170 $tmp_word[] = str_replace(
'\"',
'',$word);
172 return $tmp_word ? $tmp_word : array();
191 $this->words = array();
193 #if(!strlen($this->getQueryString()))
199 foreach($words as $word)
201 if(!strlen(trim($word)))
215 if (!in_array($fullstr, $this->words))
223 foreach($this->words as $idx => $word)
225 if(!stristr($word,
'\\'))
227 $word = str_replace(
'%',
'\%', $word);
228 $word = str_replace(
'_',
'\_', $word);
230 $this->words[$idx] = $word;
245 $this->quoted_words[] =
'';
249 while(preg_match(
"/\".*?\"/",
$query_str,$matches))
257 foreach($words as $word)
259 if(!strlen(trim($word)))
269 foreach($this->quoted_words as $idx => $word)
271 if(!stristr($word,
'\\'))
273 $word = str_replace(
'%',
'\%', $word);
274 $word = str_replace(
'_',
'\_', $word);
276 $this->quoted_words[$idx] = $word;
291 $this->
setMessage($this->lng->txt(
'msg_no_search_string'));