my $skip_search; # Skip the search reingest.
my $skip_facets; # Skip the facets reingest.
my $skip_display; # Skip the display reingest.
+my $update_rmsr; # Update reporter.materialized_simple_record table.
my $start_id; # start processing at this bib ID.
my $end_id; # stop processing when this bib ID is reached.
my $max_duration; # max processing duration in seconds
'skip-search' => \$skip_search,
'skip-facets' => \$skip_facets,
'skip-display' => \$skip_display,
+ 'update-rmsr' => \$update_rmsr,
'start-id=i' => \$start_id,
'end-id=i' => \$end_id,
'pipe' => \$opt_pipe,
--skip-display
Skip the selected reingest component
+ --update-rmsr
+ Update reporter.materialized_simple_record entries.
+ This does NOT happen unless this option is specified.
+
--start-id
Start processing at this record ID.
if (scalar(@lol) && scalar(@running) < $max_child && !$duration_expired) {
# Reuse $records for the lulz.
$records = shift(@lol);
- if ($skip_search && $skip_facets && $skip_attrs && $skip_display) {
+ if ($skip_search && $skip_facets && $skip_attrs && $skip_display && !$update_rmsr) {
$count++;
} else {
reingest($records);
reingest_attributes($dbh, $list) unless ($skip_attrs);
reingest_field_entries($dbh, $list)
unless ($skip_facets && $skip_search && $skip_display);
+ rmsr_update($dbh, $list) if ($update_rmsr);
$dbh->disconnect();
exit(0);
}
}
}
}
+
+# Update reporter.materialized_simple_record entries.
+sub rmsr_update {
+ my $dbh = shift;
+ my $list = shift;
+ my $sth = $dbh->prepare('SELECT reporter.simple_record_update(?)');
+ foreach (@$list) {
+ $sth->bind_param(1, $_);
+ if ($sth->execute()) {
+ my $crap = $sth->fetchall_arrayref();
+ } else {
+ warn ("reporter.simple_record_update failed for record $_");
+ }
+ }
+}
--- /dev/null
+pingest.pl New --update-rmsr Option
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The pingest.pl support script has a new option, `--update-rmsr`, that
+can be used to update entries in the
+reporter.materialized_simple_record table for the records being
+processed by pingest.pl. Unlike most of the options, this is not a
+skip option. It needs to be enabled for this update to take place.
+
+Furthermore, this option is not meant to be used to rebuild the
+reporter.materialized_simple_record table wholesale. If that is your
+goal, you are better off connecting to the database directly and
+running the following SQL:
+
+[source,sql]
+-----
+SELECT reporter.disable_materialized_simple_record_trigger();
+SELECT reporter.enable_materialized_simple_record_trigger();
+----