ILIAS  release_8 Revision v8.24
class.ilLuceneAdvancedQueryParser.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
31{
36 protected $query_data;
37
41 public function __construct($a_query_data)
42 {
44
45 $this->field_definition = ilLuceneAdvancedSearchFields::getInstance();
46 $this->query_data = $a_query_data;
47 }
48
53 {
55 }
56
60 public function getQueryData()
61 {
62 if (is_array($this->query_data)) {
63 return $this->query_data;
64 }
65 return $this->query_data ?? '';
66 }
67
68 public function parse(): 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 }
82}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFieldDefinition()
Get field definition settings.
ilLuceneAdvancedSearchFields $field_definition
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$query