[Koha] Find unused (not linked) authority records

Gaetan Boisson gaetan.boisson at biblibre.com
Wed Nov 29 02:40:33 NZDT 2017


You can also have a look at the remove_unused_authorities.pl script in 
src/misc/migration_tools

I think it does pretty much what you want it to. Be careful though, 
instead of having a -c for "confirm" option, it has a -t for "test" 
option. So if you launch it without -t, it will prune all your unused 
authorities. Launch it with -h the first time : 
./remove_unused_authorities.pl -h unlike other scripts, if you don't 
provide any options, it will just do its job.


Le 28/11/2017 à 10:59, Andreas Roussos a écrit :
> Hi Eric,
>
> We have a script that we use for housekeeping purposes, which (among
> other things) displays the number of records an authority is used in.
> I have adjusted said script so that it only prints those authority
> records that aren't being used in any bibliographic records. You are
> meant to access the script from your web browser since it will print
> out links that point to your staff interface, allowing you to double-
> check that the authority is not used in any records and then delete it.
>
> The output looks like this: https://imgur.com/a/ZOOvS
>
> The script requires minimal editing -- you'll need to fill in your
> Koha DB details, the URL pointing to your staff interface, and perhaps
> also change the Z39.50 server details and/or the preferred record
> syntax for retrieval (we use UNIMARC, but you probably want to set it
> to 'usmarc').
>
> The script uses PHP's YAZ extension to query Zebra using Z39.50 queries
> (yaz_connect() doesn't seem to support UNIX sockets). So, if you don't
> already have a local Z39.50 server running, you'll find instructions on
> how to set up one in /etc/koha/sites/<instancename>/koha-conf.xml.
>
> You can find the script here:
> https://github.com/a-roussos/php-koha/blob/master/koha_unused_authority_records.php
>
> Hope this helps!
>
> Kind regards,
> Andreas Roussos
> Systems Administrator
> Holy Monastery of Paraklitos
>
> On 28 November 2017 at 07:38, Eric Phetteplace <ephetteplace at cca.edu> wrote:
>> Hi all,
>>
>> I'm wondering if anyone has a way to find authority records that aren't
>> being used by any bib records currently. I can find *the opposite* in the
>> reports library; ways to check if authors or subjects in biblios aren't
>> connect to authorities. But I can't find a way to list authority records
>> used in 0 biblios even though that's very clearly displayed in the
>> authority search on the staff side.
>>
>> There's a search method which basically does exactly what I want:
>> count_auth_use
>> <https://github.com/Koha-Community/Koha/blob/master/Koha/SearchEngine/Elasticsearch/Search.pm#L248-L270>
>> will, given an authority ID, return the number of bib records it's used in.
>> So I just want records where count_auth_use = 0. Yet I can't find that
>> exposed in a way I can use or think of an easy way to write a report that
>> pulls them.
>>
>> As an aside: the purpose behind this is pruning authority records that
>> don't have linked bibs so that they don't keep showing up in our "did you
>> mean" search suggestions, because right now we have a lot of "did you mean"
>> suggestions that just link to searches with zero results.
>>
>> Best,
>>
>> ERIC PHETTEPLACE
>>
>> Systems Librarian
>>
>>
>> libraries.cca.edu | vault.cca.edu | 510.594.3660
>>
>> 5212 Broadway, Oakland, CA 94618
>>
>> 1111 8th St., San Francisco, CA 94107
>>
>> Preferred Pronoun(s): he/him
>>
>> :(){ :|: & };:
>> _______________________________________________
>> Koha mailing list  http://koha-community.org
>> Koha at lists.katipo.co.nz
>> https://lists.katipo.co.nz/mailman/listinfo/koha
> _______________________________________________
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> https://lists.katipo.co.nz/mailman/listinfo/koha

-- 
Gaetan Boisson
Chef de projet bibliothécaire
BibLibre
+33(0)6 52 42 51 29
108 rue Breteuil 13006 Marseille
gaetan.boisson at biblibre.com



More information about the Koha mailing list