35 define(
'QP_COMBINATION_AND',
'and');
36 define(
'QP_COMBINATION_OR',
'or');
60 define(MIN_WORD_LENGTH,3);
64 $this->query_str = $a_query_str;
67 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
83 if(!$a_force and $this->settings->enabledIndex() and $a_length < 3)
85 $GLOBALS[
'ilLog']->write(__METHOD__.
': Disabled min word length');
88 $this->min_word_length = $a_length;
100 $a_value = (int)$a_value;
106 $this->global_min_length = $a_value;
116 $this->wildcards_allowed = (bool)$a_value;
126 $this->message = $a_msg;
136 $this->message .=
'<br />';
138 $this->message .= $a_msg;
143 $this->combination = $a_combination;
152 return trim($this->query_str);
156 return $this->words ? $this->words : array();
163 return $this->quoted_words ? $this->quoted_words : array();
167 foreach($this->quoted_words as $word)
169 $tmp_word[] = str_replace(
'\"',
'',$word);
171 return $tmp_word ? $tmp_word : array();
190 $this->words = array();
192 #if(!strlen($this->getQueryString()))
198 foreach($words as $word)
200 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)))
270 foreach($this->quoted_words as $idx => $word)
272 if(!stristr($word,
'\\'))
274 $word = str_replace(
'%',
'\%', $word);
275 $word = str_replace(
'_',
'\_', $word);
277 $this->quoted_words[$idx] = $word;
292 $this->
setMessage($this->lng->txt(
'msg_no_search_string'));