ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilLuceneIndexer Class Reference
+ Inheritance diagram for ilLuceneIndexer:
+ Collaboration diagram for ilLuceneIndexer:

Public Member Functions

 getId ()
 
 getTitle ()
 
 getDescription ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 hasAutoActivation ()
 
 hasFlexibleSchedule ()
 
 run ()
 
- 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...
 
 getValidScheduleTypes ()
 Get all available schedule types. 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 ( )

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

42  {
43  return self::SCHEDULE_TYPE_DAILY;
44  }

◆ getDefaultScheduleValue()

ilLuceneIndexer::getDefaultScheduleValue ( )

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

47  {
48  return;
49  }

◆ getDescription()

ilLuceneIndexer::getDescription ( )

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

References $lng.

35  {
36  global $lng;
37 
38  return $lng->txt("cron_lucene_index_info");
39  }
global $lng
Definition: privfeed.php:17

◆ getId()

ilLuceneIndexer::getId ( )

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

23  {
24  return "src_lucene_indexer";
25  }

◆ getTitle()

ilLuceneIndexer::getTitle ( )

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

References $lng.

28  {
29  global $lng;
30 
31  return $lng->txt("cron_lucene_index");
32  }
global $lng
Definition: privfeed.php:17

◆ hasAutoActivation()

ilLuceneIndexer::hasAutoActivation ( )

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

52  {
53  return false;
54  }

◆ hasFlexibleSchedule()

ilLuceneIndexer::hasFlexibleSchedule ( )

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

57  {
58  return true;
59  }

◆ run()

ilLuceneIndexer::run ( )

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

References $ilSetting, $result, ilRpcClientFactory\factory(), ilLoggerFactory\getLogger(), ilCronJobResult\STATUS_FAIL, ilCronJobResult\STATUS_NO_ACTION, and ilCronJobResult\STATUS_OK.

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

References $ilSetting, ilRpcClientFactory\factory(), ilSearchSettings\getInstance(), and ilLoggerFactory\getLogger().

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

103  {
104  global $ilSetting;
105  include_once './Services/Search/classes/class.ilSearchSettings.php';
106  if (!ilSearchSettings::getInstance()->isLuceneUserSearchEnabled()) {
107  return false;
108  }
109 
110  try {
111  ilLoggerFactory::getLogger('src')->info('Lucene update index call BEGIN --- ');
112 
113  include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
114  ilRpcClientFactory::factory('RPCIndexHandler', 1)->indexObjects(
115  CLIENT_ID . '_' . $ilSetting->get('inst_id', 0),
116  $a_obj_ids
117  );
118  ilLoggerFactory::getLogger('src')->info('Lucene update index call --- END');
119  } catch (Exception $e) {
120  $error_message = $e->getMessage();
121  ilLoggerFactory::getLogger('src')->error($error_message);
122  return false;
123  }
124 
125  return true;
126  }
static factory($a_package, $a_timeout=0)
Creates an ilRpcClient instance to our ilServer.
global $ilSetting
Definition: privfeed.php:17
static getLogger($a_component_id)
Get component logger.
+ 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: