X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=perl%2Flib%2FIDZebra%2FResultset.pm;h=7408d353280e791cbfe3350d6a81a934dc9a48dc;hb=7fc45ea31ae45c60e81074183b096ea0dcc0e60c;hp=80fabdbf8a95e24012932d0659f4c0c6c317aedc;hpb=19338e444cb99f4e78aac04709bcba2e9a565e2b;p=idzebra-moved-to-github.git diff --git a/perl/lib/IDZebra/Resultset.pm b/perl/lib/IDZebra/Resultset.pm index 80fabdb..7408d35 100644 --- a/perl/lib/IDZebra/Resultset.pm +++ b/perl/lib/IDZebra/Resultset.pm @@ -1,4 +1,4 @@ -# $Id: Resultset.pm,v 1.8 2003-03-05 13:55:22 pop Exp $ +# $Id: Resultset.pm,v 1.9 2003-03-06 23:32:10 pop Exp $ # # Zebra perl API header # ============================================================================= @@ -12,7 +12,7 @@ BEGIN { use IDZebra::Logger qw(:flags :calls); use Scalar::Util qw(weaken); use Carp; - our $VERSION = do { my @r = (q$Revision: 1.8 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; + our $VERSION = do { my @r = (q$Revision: 1.9 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; our @ISA = qw(IDZebra::Logger); } @@ -91,6 +91,14 @@ sub records { my $from = $args{from} ? $args{from} : 1; my $to = $args{to} ? $args{to} : $self->{recordCount}; + if (($to-$from) >= 1000) { + if ($args{to}) { + croak ("Cannot fetch more than 1000 records at a time"); + } else { + $to = $from + 999; + } + } + my $elementSet = $args{elementSet} ? $args{elementSet} : 'R'; my $schema = $args{schema} ? $args{schema} : ''; my $recordSyntax = $args{recordSyntax} ? $args{recordSyntax} : ''; @@ -109,7 +117,6 @@ sub records { $to, $ro); - my @res = (); for (my $i=$from; $i<=$to; $i++) { @@ -118,7 +125,7 @@ sub records { if ($class) { } else { - push (@res, $rec); + push (@res, $rec); } }