Bug 13706: New script dedup_authorities.pl
authorJulian Maurice <julian.maurice@biblibre.com>
Fri, 27 Jul 2012 10:30:41 +0000 (12:30 +0200)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 26 Apr 2024 12:14:53 +0000 (14:14 +0200)
commitd9b71ff26d6cdccea4c1d61142c5254dbaff10c1
tree6b8a32dd581e39977ec9b7bc4a7eec7868f29c1c
parent566894f058759c05922ec3399ba4ca96d27978f6
Bug 13706: New script dedup_authorities.pl

This script allow to deduplicate authorities automatically.

Script is in misc/maintenance/

It works this way:
 1) authorities are fetched from the database. You can limit fetched
 results by authtypecode, or directly by specifying WHERE clause
 2) for each authority:
  2.1) build a Zebra query using the 'search_form' for the heading
  2.2) run the query, retrieve the results
  2.3) among duplicates, choose the one we want to keep (use
  --choose-method option).
  2.5) use C4::Authorities::merge to merge authorities
 3) delete the merged authorities

Use --help for more informations on options

To be done:
1 - Move to module and cover with tests
2 - Add option to only merge unused authorities
3 - Expand 'ppn' option to be 'control-number' option and allow specifying field
4 - More?

1 & 2 I will attempt - 3 & 4 may be future enhancements

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
misc/maintenance/dedup_authorities.pl [new file with mode: 0755]