X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=ffzg-search.pl;fp=ffzg-search.pl;h=b4832312cc65dea5a1d83c8a9fd43cf8579edfe7;hb=bb9a65be71eded2cc10af0a5009046cd6c89a714;hp=0000000000000000000000000000000000000000;hpb=e017296c9dbb5c8d82701fd9754d570a59bb27c0;p=koha-eprints diff --git a/ffzg-search.pl b/ffzg-search.pl new file mode 100755 index 0000000..b483231 --- /dev/null +++ b/ffzg-search.pl @@ -0,0 +1,43 @@ +#!/usr/bin/perl -I /usr/share/eprints3/perl_lib +use warnings; +use strict; +use autodie; +use utf8; + +# export single record to get structure: +use Encode; +use Data::Dump qw(dump); +use Storable; + +use EPrints; + +my $stat; + +my $ep = EPrints->new(); +my $repo = $ep->repository( 'ffzg' ); +#$repo->{config}->{enable_file_imports} = 1; +#$repo->{config}->{enable_web_imports} = 1; +my $dataset = $repo->dataset( 'eprint' ); +my $list = $dataset->search; +my $count = $list->count; +warn "# found [$count] eprints\n"; + +warn ref( $list ); + +warn "# ids = ",dump( $list->ids ); + +my $info = { count => 0 }; +$list->map( sub { + my( $session, $dataset, $eprint, $info ) = @_; + + if ( my $biblionumber = $eprint->get_value('biblionumber') ) { + push @{ $info->{biblionumber}->{$biblionumber} }, $eprint->id; + } else { + $info->{no_biblionumber}++; + } + $info->{count}++; + +}, $info ); +warn "# map info ",dump( $info ); + +warn "# stat ", dump($stat);