ILIAS  release_7 Revision v7.30-3-g800a261c036
ilLuceneIndexer Class Reference
+ Inheritance diagram for ilLuceneIndexer:
+ Collaboration diagram for ilLuceneIndexer:

Public Member Functions

 getId ()
 Get id. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 run ()
 Run job. More...
 
- Public Member Functions inherited from ilCronJob
 isActive ($a_ts_last_run, $a_schedule_type, $a_schedule_value, $a_manual=false)
 Is job currently active? More...
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule ($a_type, $a_value)
 Update current schedule (if flexible) More...
 
 getAllScheduleTypes ()
 Get all available schedule types. More...
 
 getScheduleTypesWithValues ()
 
 getValidScheduleTypes ()
 Returns a collection of all valid schedule types for a specific job. More...
 
 getTitle ()
 Get title. More...
 
 getDescription ()
 Get description. More...
 
 isManuallyExecutable ()
 Defines whether or not a cron job can be started manually. More...
 
 hasCustomSettings ()
 Has cron job any custom setting which can be edited? More...
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 Add custom settings to form. More...
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 Save custom settings. More...
 
 addToExternalSettingsForm ($a_form_id, array &$a_fields, $a_is_active)
 Add external settings to form. More...
 
 activationWasToggled ($a_currently_active)
 Cron job status was changed. More...
 
 getId ()
 Get id. More...
 
 hasAutoActivation ()
 Is to be activated on "installation". More...
 
 hasFlexibleSchedule ()
 Can the schedule be configured? More...
 
 getDefaultScheduleType ()
 Get schedule type. More...
 
 getDefaultScheduleValue ()
 Get schedule value. More...
 
 run ()
 Run job. More...
 

Static Public Member Functions

static updateLuceneIndex ($a_obj_ids)
 Update lucene index. More...
 

Protected Attributes

 $timeout = 60
 

Additional Inherited Members

- Data Fields inherited from ilCronJob
const SCHEDULE_TYPE_DAILY = 1
 
const SCHEDULE_TYPE_IN_MINUTES = 2
 
const SCHEDULE_TYPE_IN_HOURS = 3
 
const SCHEDULE_TYPE_IN_DAYS = 4
 
const SCHEDULE_TYPE_WEEKLY = 5
 
const SCHEDULE_TYPE_MONTHLY = 6
 
const SCHEDULE_TYPE_QUARTERLY = 7
 
const SCHEDULE_TYPE_YEARLY = 8
 
- Protected Member Functions inherited from ilCronJob
 checkSchedule ($a_ts_last_run, $a_schedule_type, $a_schedule_value)
 

Detailed Description

Definition at line 15 of file class.ilLuceneIndexer.php.

Member Function Documentation

◆ getDefaultScheduleType()

ilLuceneIndexer::getDefaultScheduleType ( )

Get schedule type.

Returns
int

Reimplemented from ilCronJob.

Definition at line 45 of file class.ilLuceneIndexer.php.

46 {
48 }
const SCHEDULE_TYPE_DAILY

References ilCronJob\SCHEDULE_TYPE_DAILY.

◆ getDefaultScheduleValue()

ilLuceneIndexer::getDefaultScheduleValue ( )

Get schedule value.

Returns
int|array

Reimplemented from ilCronJob.

Definition at line 50 of file class.ilLuceneIndexer.php.

51 {
52 return;
53 }

◆ getDescription()

ilLuceneIndexer::getDescription ( )

Get description.

Returns
string

Reimplemented from ilCronJob.

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

37 {
38 global $DIC;
39
40 $lng = $DIC['lng'];
41
42 return $lng->txt("cron_lucene_index_info");
43 }
global $DIC
Definition: goto.php:24
$lng

References $DIC, and $lng.

◆ getId()

ilLuceneIndexer::getId ( )

Get id.

Returns
string

Reimplemented from ilCronJob.

Definition at line 22 of file class.ilLuceneIndexer.php.

23 {
24 return "src_lucene_indexer";
25 }

◆ getTitle()

ilLuceneIndexer::getTitle ( )

Get title.

Returns
string

Reimplemented from ilCronJob.

Definition at line 27 of file class.ilLuceneIndexer.php.

28 {
29 global $DIC;
30
31 $lng = $DIC['lng'];
32
33 return $lng->txt("cron_lucene_index");
34 }

References $DIC, and $lng.

◆ hasAutoActivation()

ilLuceneIndexer::hasAutoActivation ( )

Is to be activated on "installation".

Returns
boolean

Reimplemented from ilCronJob.

Definition at line 55 of file class.ilLuceneIndexer.php.

56 {
57 return false;
58 }

◆ hasFlexibleSchedule()

ilLuceneIndexer::hasFlexibleSchedule ( )

Can the schedule be configured?

Returns
boolean

Reimplemented from ilCronJob.

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

61 {
62 return true;
63 }

◆ run()

ilLuceneIndexer::run ( )

Run job.

Returns
ilCronJobResult

Reimplemented from ilCronJob.

Definition at line 65 of file class.ilLuceneIndexer.php.

66 {
67 global $DIC;
68
69 $ilSetting = $DIC['ilSetting'];
70
72 $error_message = null;
73
74 try {
75 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
76 ilRpcClientFactory::factory('RPCIndexHandler', 60)->index(
77 CLIENT_ID . '_' . $ilSetting->get('inst_id', 0),
78 true
79 );
80 } catch (Exception $e) {
81 $error_message = $e->getMessage();
82
83 if ($e instanceof ilRpcClientException && $e->getCode() == 28) {
84 ilLoggerFactory::getLogger('src')->info('Connection timed out after ' . $this->timeout . ' seconds. ' .
85 'Indexing will continoue without a proper return message. View ilServer log if you think there are problems while indexing.');
86 $error_message = null;
87 }
88 }
89
91 if ($error_message) {
92 // #16035 - currently no way to discern the severity of the exception
93 $result->setMessage($error_message);
95 } else {
97 }
98 $result->setStatus($status);
99 return $result;
100 }
$result
Cron job result data container.
static getLogger($a_component_id)
Get component logger.
Class ilRpcClientException.
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
const CLIENT_ID
Definition: constants.php:39
global $ilSetting
Definition: privfeed.php:17

References $DIC, Vendor\Package\$e, $ilSetting, $result, CLIENT_ID, ilRpcClientFactory\factory(), ilLoggerFactory\getLogger(), ilCronJobResult\STATUS_FAIL, ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

+ Here is the call graph for this function:

◆ updateLuceneIndex()

static ilLuceneIndexer::updateLuceneIndex (   $a_obj_ids)
static

Update lucene index.

Parameters
int[]$a_obj_ids
Returns
bool

Definition at line 108 of file class.ilLuceneIndexer.php.

109 {
110 global $DIC;
111
112 $ilSetting = $DIC['ilSetting'];
113 include_once './Services/Search/classes/class.ilSearchSettings.php';
114 if (!ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
115 return false;
116 }
117
118 try {
119 ilLoggerFactory::getLogger('src')->info('Lucene update index call BEGIN --- ');
120
121 include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
122 ilRpcClientFactory::factory('RPCIndexHandler', 1)->indexObjects(
123 CLIENT_ID . '_' . $ilSetting->get('inst_id', 0),
124 $a_obj_ids
125 );
126 ilLoggerFactory::getLogger('src')->info('Lucene update index call --- END');
127 } catch (Exception $e) {
128 $error_message = $e->getMessage();
129 ilLoggerFactory::getLogger('src')->error($error_message);
130 return false;
131 }
132
133 return true;
134 }

References $DIC, Vendor\Package\$e, $ilSetting, CLIENT_ID, ilRpcClientFactory\factory(), ilSearchSettings\getInstance(), and ilLoggerFactory\getLogger().

Referenced by ilPersonalProfileGUI\saveProfile(), and ilPersonalProfileGUI\savePublicProfile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $timeout

ilLuceneIndexer::$timeout = 60
protected

Definition at line 20 of file class.ilLuceneIndexer.php.


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