ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
class.ilMailLuceneSearcher.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
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 CLIENT_ID . '_' . $this->settings->get('inst_id', '0'),
40 $user_id,
41 $this->query_parser->getQuery(),
42 $mail_folder_id
43 );
44 } catch (Exception $e) {
45 ilLoggerFactory::getLogger('mail')->critical($e->getMessage());
46 throw $e;
47 }
48
49 $parser = new ilMailSearchLuceneResultParser($this->result, $xml);
50 $parser->parse();
51 }
52}
static getLogger(string $a_component_id)
Get component logger.
__construct(protected ilLuceneQueryParser $query_parser, protected ilMailSearchResult $result)
search(int $user_id, int $mail_folder_id)
static factory(string $package, int $timeout=0)
ILIAS Setting Class.
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: shib_login.php:26