ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLuceneAdvancedQueryParser Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilLuceneAdvancedQueryParser:
+ Collaboration diagram for ilLuceneAdvancedQueryParser:

Public Member Functions

 __construct ($a_query_data)
 Constructor. More...
 
 getFieldDefinition ()
 Get field definition settings. More...
 
 getQueryData ()
 
 parse ()
 
- 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

ilLuceneAdvancedSearchFields $field_definition
 
 $query_data
 
- 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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 30 of file class.ilLuceneAdvancedQueryParser.php.

Constructor & Destructor Documentation

◆ __construct()

ilLuceneAdvancedQueryParser::__construct (   $a_query_data)

Constructor.

Definition at line 41 of file class.ilLuceneAdvancedQueryParser.php.

References ILIAS\GlobalScreen\Provider\__construct(), and ilLuceneAdvancedSearchFields\getInstance().

42  {
44 
45  $this->field_definition = ilLuceneAdvancedSearchFields::getInstance();
46  $this->query_data = $a_query_data;
47  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getFieldDefinition()

ilLuceneAdvancedQueryParser::getFieldDefinition ( )

Get field definition settings.

Definition at line 52 of file class.ilLuceneAdvancedQueryParser.php.

References $field_definition.

Referenced by parse().

53  {
55  }
ilLuceneAdvancedSearchFields $field_definition
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getQueryData()

ilLuceneAdvancedQueryParser::getQueryData ( )
Returns
array|string

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

References $query_data.

Referenced by parse().

61  {
62  if (is_array($this->query_data)) {
63  return $this->query_data;
64  }
65  return $this->query_data ?? '';
66  }
+ Here is the caller graph for this function:

◆ parse()

ilLuceneAdvancedQueryParser::parse ( )

Definition at line 68 of file class.ilLuceneAdvancedQueryParser.php.

References $query, getFieldDefinition(), and getQueryData().

Referenced by ilLuceneAdvancedSearchGUI\performSearch(), and ilLuceneAdvancedSearchGUI\showSavedResults().

68  : void
69  {
70  foreach ((array) $this->getQueryData() as $field => $query) {
71  if (!is_array($query) && !trim($query)) {
72  continue;
73  }
74  $parsed = $this->getFieldDefinition()->parseFieldQuery((string) $field, $query);
75  if (strlen($parsed)) {
76  $this->parsed_query .= " +(";
77  $this->parsed_query .= $parsed;
78  $this->parsed_query .= ") ";
79  }
80  }
81  }
getFieldDefinition()
Get field definition settings.
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $field_definition

ilLuceneAdvancedSearchFields ilLuceneAdvancedQueryParser::$field_definition
protected

Definition at line 32 of file class.ilLuceneAdvancedQueryParser.php.

Referenced by getFieldDefinition().

◆ $query_data

ilLuceneAdvancedQueryParser::$query_data
protected

Definition at line 36 of file class.ilLuceneAdvancedQueryParser.php.

Referenced by getQueryData().


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