Linking biblios to authorities
Hi,we are migrating a library that have some 60.000 records and 25.000 authorities. The import of the biblios and authorities works fine, but... we need to link them. Up to now the procedure we follow is to import the authorities, dump the data to find out which "authid" koha assigned to each one, then scan the xml o marcedit file of the biblio data, putting on any matching field a $9 subfield with the corresponding "authid". Then we import this data and all is done, works fine. What wonders me is why is not working the script "/usr/share/koha/bin/link_bibs_to_authorities.pl"? When we run it, all we obtained is the removal of the links to authorities that we have! An inspection of the file shows that it use the procedure LinkBibHeadingsToAuthorities() from C4/Biblio.pm. In that file the following line my $authorities = $heading->authorities(); gives a null result and that explains the removal of my links (following the algorithm). Inspecting C4/Heading.pm we found that the line to find matching authorities is my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] ); which in turn guides us to C4/Search.pm (implementation of SimpleSearch), in which there is this line $zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]); Now, the authorities search in opac and staff interfaces (which give correct results!) use a different procedure for the query in C4/AuthoritiesMarc.pm my $Anewq= new ZOOM::Query::PQF($query,$oAuth[0]); Then I read a little about the difference between PQF and CCL queries, and I must confess... I am lost. The only I know is that one kind of query gives results and the other no. Then my questions to the list: 1) Have any of you been able to make the former script work properly? And how? 2) Is there a procedure to make CCL queries works, if that is the reason? Perhaps tweaking koha-conf.xml? 3) It's a problem with the configuration of the zebra server? 4) Have you know of any other "automatic" procedure to do the job? We are using Koha 3.01.00.014 on Ubuntu 8.04. The last git checkout (3.01.00.018) changes several files but no the previous lines . Cheers, bgk
Bernardo Gonzalez Kriegel wrote:
What wonders me is why is not working the script "/usr/share/koha/bin/link_bibs_to_authorities.pl"? When we run it, all we obtained is the removal of the links to authorities that we have!
An inspection of the file shows that it use the procedure LinkBibHeadingsToAuthorities() from C4/Biblio.pm. In that file the following line
my $authorities = $heading->authorities();
gives a null result and that explains the removal of my links (following the algorithm). Inspecting C4/Heading.pm we found that the line to find matching authorities is
my ($error, $results, $total_hits) = SimpleSearch( $query, undef, undef, [ "authorityserver" ] );
which in turn guides us to C4/Search.pm (implementation of SimpleSearch), in which there is this line
$zoom_queries[$i] = new ZOOM::Query::CCL2RPN( $query, $zconns[$i]);
The problem is probably in the $query. The zebrasrv may be logging an error that clarifies this. A problem I've found in running this job is that the query is using an undefined attribute. Try this change in AuthoritiesMarc.pm: diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f9bf733..32dec17 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -220,7 +220,7 @@ sub SearchAuthorities { if (@$value[$i]){ ##If mainentry search $a tag if (@$tags[$i] eq "mainmainentry") { - $attr =" \@attr 1=Heading-Main "; + $attr =" \@attr 1=Heading "; }elsif (@$tags[$i] eq "mainentry") { $attr =" \@attr 1=Heading "; The change is present in HEAD but not in 3.0.x Hope that helps Colin -- Colin Campbell Software Engineer, PTFS Europe Limited Content Management and Library Solutions +44 (0) 208 366 1295 (phone) +44 (0) 7759 633626 (mobile) colin.campbell@ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com
Colin, thank you for your response, but it doesn't wok. And the logs do not show any error! It's a mistery... Thank you bgk
The problem is probably in the $query. The zebrasrv may be logging an error that clarifies this. A problem I've found in running this job is that the query is using an undefined attribute. Try this change in AuthoritiesMarc.pm: diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f9bf733..32dec17 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -220,7 +220,7 @@ sub SearchAuthorities { if (@$value[$i]){ ##If mainentry search $a tag if (@$tags[$i] eq "mainmainentry") { - $attr =" \@attr 1=Heading-Main "; + $attr =" \@attr 1=Heading "; }elsif (@$tags[$i] eq "mainentry") { $attr =" \@attr 1=Heading ";
The change is present in HEAD but not in 3.0.x
Hope that helps Colin
-- Colin Campbell
participants (2)
-
Bernardo Gonzalez Kriegel -
Colin Campbell