Lucene query parser.
More...
◆ __construct()
ilLuceneQueryParser::__construct |
( |
|
$a_query_string | ) |
|
◆ checkAllowedCharacters()
static ilLuceneQueryParser::checkAllowedCharacters |
( |
string |
$query | ) |
|
|
staticprotected |
◆ checkAmpersands()
static ilLuceneQueryParser::checkAmpersands |
( |
string |
$query | ) |
|
|
staticprotected |
Check ampersands.
- Exceptions
-
Definition at line 145 of file class.ilLuceneQueryParser.php.
147 if (preg_match(
'/[&]{2}/',
$query) > 0) {
148 if (preg_match(
'/^([\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+( && )?[\pL0-9_+\-:.()\"*?|!{}\[\]\^~\\@#\/$%\'=]+[ ]*)+$/u',
$query) == 0) {
◆ checkANDORNOT()
static ilLuceneQueryParser::checkANDORNOT |
( |
string |
$a_query | ) |
|
|
staticprotected |
Check AND OR NOT.
- Exceptions
-
Definition at line 261 of file class.ilLuceneQueryParser.php.
263 if (preg_match(
'/^([\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@\/#$%\'=]+\s*((AND )|(OR )|(AND NOT )|(NOT ))?[\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@\/#$%\'=]+[ ]*)+$/u', $a_query) == 0) {
◆ checkAsterisk()
static ilLuceneQueryParser::checkAsterisk |
( |
string |
$query | ) |
|
|
staticprotected |
◆ checkCaret()
static ilLuceneQueryParser::checkCaret |
( |
string |
$query | ) |
|
|
staticprotected |
◆ checkColon()
static ilLuceneQueryParser::checkColon |
( |
string |
$a_query | ) |
|
|
staticprotected |
Check colon.
- Exceptions
-
Definition at line 297 of file class.ilLuceneQueryParser.php.
299 if (preg_match(
'/[^\\\\s]:[\s]|[^\\\\s]:$|[\s][^\\]?:|^[^\\\\s]?:/', $a_query) != 0) {
◆ checkExclamationMark()
static ilLuceneQueryParser::checkExclamationMark |
( |
string |
$query | ) |
|
|
staticprotected |
Check exclamation marks (replacement for NOT)
- Exceptions
-
Definition at line 183 of file class.ilLuceneQueryParser.php.
185 if (preg_match(
'/^[^!]*$|^([\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+( ! )?[\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+[ ]*)+$/u',
$query, $matches) == 0) {
◆ checkParenthesis()
static ilLuceneQueryParser::checkParenthesis |
( |
string |
$a_query | ) |
|
|
staticprotected |
Check parenthesis.
- Exceptions
-
Definition at line 207 of file class.ilLuceneQueryParser.php.
Referenced by validateQuery().
217 if (($matchLft = preg_match_all(
'/[(]/', $a_query, $tmp)) > 0) {
220 if (($matchRgt = preg_match_all(
'/[)]/', $a_query, $tmp)) > 0) {
224 if (!$hasLft || !$hasRgt) {
229 if (($hasLft && !$hasRgt) || ($hasRgt && !$hasLft)) {
233 if ($matchLft !== $matchRgt) {
237 if (preg_match(
'/\(\s*\)/', $a_query) > 0) {
◆ checkPlusMinus()
static ilLuceneQueryParser::checkPlusMinus |
( |
string |
$a_query | ) |
|
|
staticprotected |
Check plus minus.
- Exceptions
-
Definition at line 248 of file class.ilLuceneQueryParser.php.
250 if (preg_match(
'/^[^\n+\-]*$|^([+-]?\s*[\pL0-9_:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]+[ ]?)+$/u', $a_query) == 0) {
◆ checkQuestionMark()
static ilLuceneQueryParser::checkQuestionMark |
( |
string |
$query | ) |
|
|
staticprotected |
Check question mark (wild card single character)
- Exceptions
-
Definition at line 195 of file class.ilLuceneQueryParser.php.
197 if (preg_match(
'/^(\?)|([^\pL0-9_+\-:.()\"*?&|!{}\[\]\^~\\@#\/$%\'=]\?+)/u',
$query, $matches) != 0) {
◆ checkQuotes()
static ilLuceneQueryParser::checkQuotes |
( |
string |
$a_query | ) |
|
|
staticprotected |
Check quotes.
- Exceptions
-
Definition at line 274 of file class.ilLuceneQueryParser.php.
Referenced by validateQuery().
276 $matches = preg_match_all(
'/"/', $a_query, $tmp);
282 if (($matches % 2) > 0) {
286 if (preg_match(
'/"\s*"/', $a_query) > 0) {
◆ checkSquiggle()
static ilLuceneQueryParser::checkSquiggle |
( |
string |
$query | ) |
|
|
staticprotected |
◆ getQuery()
ilLuceneQueryParser::getQuery |
( |
| ) |
|
◆ parse()
ilLuceneQueryParser::parse |
( |
| ) |
|
◆ parseAutoWildcard()
ilLuceneQueryParser::parseAutoWildcard |
( |
| ) |
|
Append asterisk for remote search from global search form field.
Definition at line 66 of file class.ilLuceneQueryParser.php.
68 $this->parsed_query = trim($this->query_string);
69 if (stristr($this->parsed_query,
'*')) {
72 if (substr($this->parsed_query, -1) !==
'"') {
73 $this->parsed_query .=
'*';
◆ replaceOwnerCallback()
ilLuceneQueryParser::replaceOwnerCallback |
( |
array |
$matches | ) |
|
|
protected |
Replace owner callback (preg_replace_callback)
Definition at line 85 of file class.ilLuceneQueryParser.php.
References ilObjUser\_loginExists().
87 if (isset($matches[2])) {
89 return $matches[1] . $usr_id;
static _loginExists(string $a_login, int $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
◆ validateQuery()
static ilLuceneQueryParser::validateQuery |
( |
|
$a_query | ) |
|
|
static |
◆ $parsed_query
string ilLuceneQueryParser::$parsed_query = '' |
|
protected |
◆ $query_string
string ilLuceneQueryParser::$query_string |
|
protected |
The documentation for this class was generated from the following file: