From 39c71a13a01e89e91a91472492adef5fa8910084 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 25 Jan 2019 08:14:40 -0500 Subject: [PATCH] Lp 1813172: Option to Specify Attributes for Reingest in pingest.pl Add the --attr option to pingest.pl to specify one or more specific attributes to be reingested by metabib.reingest_record_attributes. Add a release note. Signed-off-by: Jason Stephenson Signed-off-by: Bill Erickson --- Open-ILS/src/support-scripts/pingest.pl | 13 ++++++++++-- .../pingest-specify-record-atrributes.adoc | 21 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docs/RELEASE_NOTES_NEXT/Administration/pingest-specify-record-atrributes.adoc diff --git a/Open-ILS/src/support-scripts/pingest.pl b/Open-ILS/src/support-scripts/pingest.pl index d351cfacb5..c39981a9f4 100755 --- a/Open-ILS/src/support-scripts/pingest.pl +++ b/Open-ILS/src/support-scripts/pingest.pl @@ -39,6 +39,7 @@ my $end_id; # stop processing when this bib ID is reached. 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'; @@ -64,6 +65,7 @@ GetOptions( 'end-id=i' => \$end_id, 'pipe' => \$opt_pipe, 'max-duration=i' => \$max_duration, + 'attr=s@' => \$record_attrs, 'help' => \$help ); @@ -86,6 +88,12 @@ sub 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. @@ -301,13 +309,14 @@ sub reingest_attributes { my $dbh = shift; my $list = shift; my $sth = $dbh->prepare(<bind_param(1, $record_attrs); foreach (@$list) { - $sth->bind_param(1, $_); + $sth->bind_param(2, $_); if ($sth->execute()) { my $crap = $sth->fetchall_arrayref(); } else { diff --git a/docs/RELEASE_NOTES_NEXT/Administration/pingest-specify-record-atrributes.adoc b/docs/RELEASE_NOTES_NEXT/Administration/pingest-specify-record-atrributes.adoc new file mode 100644 index 0000000000..2f3bf7e8de --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/Administration/pingest-specify-record-atrributes.adoc @@ -0,0 +1,21 @@ +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 +---- + -- 2.43.2