function apachesolr_index_batch_index_finished in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 apachesolr.admin.inc \apachesolr_index_batch_index_finished()
- 7 apachesolr.admin.inc \apachesolr_index_batch_index_finished()
Batch 'finished' callback
1 string reference to 'apachesolr_index_batch_index_finished'
- apachesolr_index_batch_index_remaining in ./
apachesolr.admin.inc - Submit a batch job to index the remaining, unindexed content.
File
- ./
apachesolr.admin.inc, line 1140 - Administrative pages for the Apache Solr framework.
Code
function apachesolr_index_batch_index_finished($success, $results, $operations) {
$message = '';
// $results['count'] will not be set if Solr is unavailable.
if (isset($results['count'])) {
$message .= format_plural($results['count'], '1 item processed successfully. ', '@count items successfully processed. ');
}
if (isset($results['submitted'])) {
$message .= format_plural($results['submitted'], '1 document successfully sent to Solr.', '@count documents successfully sent to Solr.');
}
if ($success) {
$type = 'status';
}
else {
// An error occurred. $operations contains the unprocessed operations.
$error_operation = reset($operations);
$message .= ' ' . t('An error occurred while processing @num with arguments: @args', array(
'@num' => $error_operation[0],
'@args' => print_r($error_operation[0], TRUE),
));
$type = 'error';
}
drupal_set_message($message, $type);
}