35 define(
'QP_COMBINATION_AND',
'and');
36 define(
'QP_COMBINATION_OR',
'or');
65 define(
'MIN_WORD_LENGTH',self::MIN_WORD_LENGTH);
69 $this->query_str = $a_query_str;
72 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
88 if(!$a_force
and $this->
settings->enabledIndex()
and $a_length < 3)
93 $this->min_word_length = $a_length;
103 if($a_value !== null)
105 $a_value = (int)$a_value;
111 $this->global_min_length = $a_value;
121 $this->wildcards_allowed = (bool)$a_value;
131 $this->message = $a_msg;
141 $this->message .=
'<br />';
143 $this->message .= $a_msg;
148 $this->combination = $a_combination;
157 return trim($this->query_str);
161 return $this->words ? $this->words :
array();
168 return $this->quoted_words ? $this->quoted_words :
array();
172 foreach($this->quoted_words as $word)
174 $tmp_word[] = str_replace(
'\"',
'',$word);
176 return $tmp_word ? $tmp_word :
array();
195 $this->words =
array();
197 #if(!strlen($this->getQueryString())) 203 foreach($words as $word)
205 if(!strlen(trim($word)))
220 if (!in_array($fullstr, $this->words))
228 foreach($this->words as $idx => $word)
230 if(!stristr($word,
'\\'))
232 $word = str_replace(
'%',
'\%', $word);
233 $word = str_replace(
'_',
'\_', $word);
235 $this->words[$idx] = $word;
250 $this->quoted_words[] =
'';
254 while(preg_match(
"/\".*?\"/",$query_str,$matches))
256 $query_str = str_replace($matches[0],
'',$query_str);
261 $words = explode(
' ',trim($query_str));
262 foreach($words as $word)
264 if(!strlen(trim($word)))
275 foreach($this->quoted_words as $idx => $word)
277 if(!stristr($word,
'\\'))
279 $word = str_replace(
'%',
'\%', $word);
280 $word = str_replace(
'_',
'\_', $word);
282 $this->quoted_words[$idx] = $word;
297 $this->
setMessage($this->lng->txt(
'msg_no_search_string'));
getQuotedWords($with_quotation=false)
const MIN_WORD_LENGTH
Minimum of characters required for search.
__construct($a_query_str)
Constructor public.
setGlobalMinLength($a_value)
Create styles array
The data for the language used.
static prepareDBString($a_str)
prepare a string for db writing (insert/update)
setCombination($a_combination)
static getLogger($a_component_id)
Get component logger.
setMinWordLength($a_length, $a_force=false)
setAllowedWildcards($a_value)