ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
class.ilMailLuceneSearcher.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  protected ilSetting $settings;
24 
25  public function __construct(protected ilLuceneQueryParser $query_parser, protected ilMailSearchResult $result)
26  {
27  global $DIC;
28  $this->settings = $DIC->settings();
29  }
30 
31  public function search(int $user_id, int $mail_folder_id): void
32  {
33  if ($this->query_parser->getQuery() === '') {
34  throw new ilMailException('mail_search_query_missing');
35  }
36 
37  try {
38  $xml = ilRpcClientFactory::factory('RPCSearchHandler')->searchMail();
39  } catch (Exception $e) {
40  ilLoggerFactory::getLogger('mail')->critical($e->getMessage());
41  throw $e;
42  }
43 
44  $parser = new ilMailSearchLuceneResultParser($this->result, $xml);
45  $parser->parse();
46  }
47 }
static getLogger(string $a_component_id)
Get component logger.
search(int $user_id, int $mail_folder_id)
static factory(string $a_package, int $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
global $DIC
Definition: shib_login.php:26
__construct(protected ilLuceneQueryParser $query_parser, protected ilMailSearchResult $result)