ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
70  include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';
71  ilRpcClientFactory::factory('RPCIndexHandler',60)->index(
72  CLIENT_ID.'_'.$ilSetting->get('inst_id',0),
73  true
74  );
75  }
76  catch(Exception $e)
77  {
78  $error_message = $e->getMessage();
79 
80  if($e instanceof ilRpcClientException && $e->getCode() == 28)
81  {
82  ilLoggerFactory::getLogger('src')->info('Connection timed out after ' . $this->timeout . ' seconds. '.
83  'Indexing will continoue without a proper return message. View ilServer log if you think there are problems while indexing.');
84  $error_message = null;
85  }
86 
87  }
88 
89  $result = new ilCronJobResult();
90  if($error_message)
91  {
92  // #16035 - currently no way to discern the severity of the exception
93  $result->setMessage($error_message);
95  }
96  else
97  {
99  }
100  $result->setStatus($status);
101  return $result;
102  }
$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 110 of file class.ilLuceneIndexer.php.

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

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

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