my $max_duration; # max processing duration in seconds
my $help; # show help text
my $opt_pipe; # Read record ids from STDIN.
+my $record_attrs; # Record attributes for metabib.reingest_record_attributes.
# Database connection options with defaults:
my $db_user = $ENV{PGUSER} || 'evergreen';
'end-id=i' => \$end_id,
'pipe' => \$opt_pipe,
'max-duration=i' => \$max_duration,
+ 'attr=s@' => \$record_attrs,
'help' => \$help
);
--skip-display
Skip the selected reingest component
+ --attr
+ Specify a record attribute for ingest
+ This option can be used more than once to specify multiple
+ attributes to ingest.
+ This option is ignored if --skip-attrs is also given.
+
--start-id
Start processing at this record ID.
my $dbh = shift;
my $list = shift;
my $sth = $dbh->prepare(<<END_OF_INGEST
-SELECT metabib.reingest_record_attributes(rid := id, prmarc := marc)
+SELECT metabib.reingest_record_attributes(rid := id, prmarc := marc, pattr_list := ?)
FROM biblio.record_entry
WHERE id = ?
END_OF_INGEST
);
+ $sth->bind_param(1, $record_attrs);
foreach (@$list) {
- $sth->bind_param(1, $_);
+ $sth->bind_param(2, $_);
if ($sth->execute()) {
my $crap = $sth->fetchall_arrayref();
} else {
--- /dev/null
+Ability to Reingest Certain Record Attributes In pingest.pl
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+An option, `--attr`, has been added to the `pingest.pl` support script
+that allows the user to specify which record attributes to reingest.
+This option is used to specify which record attribute(s) to reingest.
+It can be used one or more times to specify one or more attributes to
+ingest. It can be omitted to reingest all record attributes. This
+option is ignored if the `--skip-attrs` option is used.
+
+The `--attr` option is most useful after doing something specific that
+requires only a partial ingest of records. For instance, if you add a
+new language to the `config.coded_value_map` table, you will want to
+reingest the `item_lang` attribute on all of your records. The
+following command line will do that, and only that, ingest:
+
+----
+$ /openils/bin/pingest.pl --skip-browse --skip-search --skip-facets \
+ --skip-display --attr=item_lang
+----
+