24 include_once
'./Services/Search/classes/Lucene/class.ilLuceneQueryParserException.php';
48 $this->query_string = $a_query_string;
57 $this->parsed_query = preg_replace_callback(
'/(owner:)\s?([A-Za-z0-9_\.\+\*\@!\$\%\~\-]+)/',array($this,
'replaceOwnerCallback'),$this->query_string);
74 if(isset($matches[2]))
78 return $matches[1].$usr_id;
94 #ilLuceneQueryParser::checkAllowedCharacters($a_query);
95 #ilLuceneQueryParser::checkAsterisk($a_query);
96 #ilLuceneQueryParser::checkAmpersands($a_query);
99 #ilLuceneQueryParser::checkExclamationMark($a_query);
100 #ilLuceneQueryParser::checkQuestionMark($a_query);
102 #ilLuceneQueryParser::checkPlusMinus($a_query);
103 #ilLuceneQueryParser::checkANDORNOT($a_query);
105 #ilLuceneQueryParser::checkColon($a_query);
115 if(preg_match(
'/[^\pL0-9_+\-:.()\"*?&§€|!{}\[\]\^~\\@#\/$%\'= ]/u',
$query) != 0)
128 if(preg_match(
'/^[\*]*$|[\s]\*|^\*[^\s]/',
$query) != 0)
141 if(preg_match(
'/[&]{2}/',
$query) > 0)
143 if(preg_match(
'/^([\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+( && )?[\pL0-9_+\-:.()\"*?|!{}\[\]\^~\\@#\/$%\'=]+[ ]*)+$/u',
$query) == 0)
157 if(preg_match(
'/[^\\\]\^([^\s]*[^0-9.]+)|[^\\\]\^$/',
$query) != 0)
170 if(preg_match(
'/[^\\\]*~[^\s]*[^0-9\s]+/',
$query,$matches) != 0)
183 if(preg_match(
'/^[^!]*$|^([\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+( ! )?[\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+[ ]*)+$/u',
$query,$matches) == 0)
196 if(preg_match(
'/^(\?)|([^\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]\?+)/u',
$query,$matches) != 0)
217 if(($matchLft = preg_match_all(
'/[(]/',$a_query,$tmp)) > 0)
221 if(($matchRgt = preg_match_all(
'/[)]/',$a_query,$tmp)) > 0)
226 if(!$hasLft || !$hasRgt)
232 if(($hasLft && !$hasRgt) || ($hasRgt && !$hasLft))
237 if($matchLft !== $matchRgt)
242 if(preg_match(
'/\(\s*\)/',$a_query) > 0)
256 if(preg_match(
'/^[^\n+\-]*$|^([+-]?\s*[\pL0-9_:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+[ ]?)+$/u',$a_query) == 0)
272 if(preg_match(
'/^([\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@\/#$%\'=]+\s*((AND )|(OR )|(AND NOT )|(NOT ))?[\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@\/#$%\'=]+[ ]*)+$/u',$a_query) == 0)
286 $matches = preg_match_all(
'/"/',$a_query,$tmp);
293 if(($matches % 2) > 0)
298 if(preg_match(
'/"\s*"/',$a_query) > 0)
313 if(preg_match(
'/[^\\\\s]:[\s]|[^\\\\s]:$|[\s][^\\]?:|^[^\\\\s]?:/',$a_query) != 0)