ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilMailLuceneQueryParser Class Reference
+ Inheritance diagram for ilMailLuceneQueryParser:
+ Collaboration diagram for ilMailLuceneQueryParser:

Public Member Functions

 parse ()
 
 setFields (array $fields)
 
 getFields ()
 
- Public Member Functions inherited from ilLuceneQueryParser
 __construct ($a_query_string)
 Constructor. More...
 
 parse ()
 parse query string More...
 
 parseAutoWildcard ()
 Append asterisk for remote search from global search form field. More...
 
 getQuery ()
 

Protected Attributes

array $fields = []
 
- Protected Attributes inherited from ilLuceneQueryParser
string $query_string
 
string $parsed_query = ''
 

Additional Inherited Members

- Static Public Member Functions inherited from ilLuceneQueryParser
static validateQuery ($a_query)
 
- Protected Member Functions inherited from ilLuceneQueryParser
 replaceOwnerCallback (array $matches)
 Replace owner callback (preg_replace_callback) More...
 
- Static Protected Member Functions inherited from ilLuceneQueryParser
static checkAllowedCharacters (string $query)
 Check allowed characters. More...
 
static checkAsterisk (string $query)
 Check asterisk. More...
 
static checkAmpersands (string $query)
 Check ampersands. More...
 
static checkCaret (string $query)
 Check carets. More...
 
static checkSquiggle (string $query)
 Check squiggles. More...
 
static checkExclamationMark (string $query)
 Check exclamation marks (replacement for NOT) More...
 
static checkQuestionMark (string $query)
 Check question mark (wild card single character) More...
 
static checkParenthesis (string $a_query)
 Check parenthesis. More...
 
static checkPlusMinus (string $a_query)
 Check plus minus. More...
 
static checkANDORNOT (string $a_query)
 Check AND OR NOT. More...
 
static checkQuotes (string $a_query)
 Check quotes. More...
 
static checkColon (string $a_query)
 Check colon. More...
 

Detailed Description

Definition at line 21 of file class.ilMailLuceneQueryParser.php.

Member Function Documentation

◆ getFields()

ilMailLuceneQueryParser::getFields ( )

Definition at line 65 of file class.ilMailLuceneQueryParser.php.

References $fields.

Referenced by parse().

65  : array
66  {
67  return $this->fields;
68  }
+ Here is the caller graph for this function:

◆ parse()

ilMailLuceneQueryParser::parse ( )

Definition at line 25 of file class.ilMailLuceneQueryParser.php.

References $token, getFields(), ilSearchSettings\getInstance(), and ilSearchSettings\OPERATOR_AND.

25  : void
26  {
27  if ($this->getFields()) {
28  $queried_fields = [];
29  $token_operator = ' OR ';
30  if (ilSearchSettings::getInstance()->getDefaultOperator() === ilSearchSettings::OPERATOR_AND) {
31  $token_operator = ' AND ';
32  }
33 
34  foreach ($this->getFields() as $field => $status) {
35  if (!$status) {
36  continue;
37  }
38 
39  $field_query = '';
40  $tokens = array_map(trim(...), explode(' ', $this->query_string));
41  foreach ($tokens as $token) {
42  if ($field_query !== '') {
43  $field_query .= $token_operator;
44  }
45  $field_query .= '(' . $field . ':' . $token . ')';
46  }
47 
48  $queried_fields[] = '(' . $field_query . ')';
49  }
50 
51  if ($queried_fields !== []) {
52  $this->parsed_query = implode(' OR ', $queried_fields);
53  return;
54  }
55  }
56 
57  parent::parse();
58  }
$token
Definition: xapitoken.php:70
+ Here is the call graph for this function:

◆ setFields()

ilMailLuceneQueryParser::setFields ( array  $fields)

Definition at line 60 of file class.ilMailLuceneQueryParser.php.

References $fields.

60  : void
61  {
62  $this->fields = $fields;
63  }

Field Documentation

◆ $fields

array ilMailLuceneQueryParser::$fields = []
protected

Definition at line 23 of file class.ilMailLuceneQueryParser.php.

Referenced by getFields(), and setFields().


The documentation for this class was generated from the following file: