ILIAS  release_8 Revision v8.24
class.ilMailLuceneSearcher.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
26{
30
32 {
33 global $DIC;
34 $this->settings = $DIC->settings();
35 $this->query_parser = $query_parser;
36 $this->result = $result;
37 }
38
39 public function search(int $user_id, int $mail_folder_id): void
40 {
41 if (!$this->query_parser->getQuery()) {
42 throw new ilException('mail_search_query_missing');
43 }
44
45 try {
46 $xml = ilRpcClientFactory::factory('RPCSearchHandler')->searchMail(
47 CLIENT_ID . '_' . $this->settings->get('inst_id', '0'),
48 $user_id,
49 $this->query_parser->getQuery(),
50 $mail_folder_id
51 );
52 } catch (Exception $e) {
53 ilLoggerFactory::getLogger('mail')->critical($e->getMessage());
54 throw $e;
55 }
56
57 $parser = new ilMailSearchLuceneResultParser($this->result, $xml);
58 $parser->parse();
59 }
60}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
ilLuceneQueryParser $query_parser
__construct(ilLuceneQueryParser $query_parser, ilMailSearchResult $result)
search(int $user_id, int $mail_folder_id)
static factory(string $a_package, int $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CLIENT_ID
Definition: constants.php:41
global $DIC
Definition: feed.php:28
$xml
Definition: metadata.php:351