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';
87 if (!$a_force and $this->
settings->enabledIndex() and $a_length < 3) {
91 $this->min_word_length = $a_length;
101 if ($a_value !== null) {
102 $a_value = (int) $a_value;
107 $this->global_min_length = $a_value;
117 $this->wildcards_allowed = (bool) $a_value;
127 $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();
161 if ($with_quotation) {
162 return $this->quoted_words ? $this->quoted_words :
array();
164 foreach ($this->quoted_words as $word) {
165 $tmp_word[] = str_replace(
'\"',
'', $word);
167 return $tmp_word ? $tmp_word :
array();
185 $this->words =
array();
187 #if(!strlen($this->getQueryString())) 193 foreach ($words as $word) {
194 if (!strlen(trim($word))) {
207 if (!in_array($fullstr, $this->words)) {
213 foreach ($this->words as $idx => $word) {
214 if (!stristr($word,
'\\')) {
215 $word = str_replace(
'%',
'\%', $word);
216 $word = str_replace(
'_',
'\_', $word);
218 $this->words[$idx] = $word;
232 $this->quoted_words[] =
'';
236 while (preg_match(
"/\".*?\"/",
$query_str, $matches)) {
243 foreach ($words as $word) {
244 if (!strlen(trim($word))) {
253 foreach ($this->quoted_words as $idx => $word) {
254 if (!stristr($word,
'\\')) {
255 $word = str_replace(
'%',
'\%', $word);
256 $word = str_replace(
'_',
'\_', $word);
258 $this->quoted_words[$idx] = $word;
271 $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)