Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use daily Allegro dump in transformAndIndex.sh script (RPB-101) #55

Merged
merged 3 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ RPB-Export_HBZ_SW.txt
RPB-Export_HBZ_Tit.txt
RPB-Export_HBZ_Tit_hbzIds.txt
RPB-Export_HBZ_Bio.txt
RPB-Export_HBZ_Ort.txt
RPB-Export_HBZ_Raum.txt
RPB-Export_HBZ_SWN.txt
RPB-Export_HBZ_Syst.txt
RPB-Export_HBZ_ZSS.txt
conf/RPBEXP/*.ZIP
nohup.out*
Empty file added conf/RPBEXP/.empty
Empty file.
2 changes: 1 addition & 1 deletion conf/rpb-titel-to-lobid.flux
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ default outfile = "conf/output/bulk/bulk-${i}.ndjson";
| fix(FLUX_DIR + "rpb-titel-to-lobid.fix")
| batch-reset(batchsize="1000")
| encode-json(prettyPrinting="false")
| json-to-elasticsearch-bulk(idkey="id", type="resource", index="resources-alma-fix-staging")
| json-to-elasticsearch-bulk(idkey="id", type="resource", index="resources-rpb-test")
| write(outfile)
;
9 changes: 9 additions & 0 deletions transformAndIndex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@
set -eu
IFS=$'\n\t'

# Get the daily Allegro dump:
cd conf
wget https://rpb.lbz-rlp.de/rpb04/intern/RPBEXP.ZIP
unzip -o RPBEXP.ZIP
mv RPBEXP.ZIP RPBEXP/RPBEXP-$(date "+%Y%m%d-%H%M").ZIP
cd ..

# Transform the data:
sbt "runMain rpb.ETL conf/rpb-sw.flux"
sbt "runMain rpb.ETL conf/rpb-titel-to-strapi.flux"
sbt "runMain rpb.ETL conf/rpb-titel-to-lobid.flux"

# Index to Elasticsearch:
unset http_proxy # for posting to weywot3
for filename in conf/output/bulk/bulk-*.ndjson
do
Expand Down