LibreCat / Catmandu-SRU

Catmandu module for working with SRU data.
https://metacpan.org/release/Catmandu-SRU
5 stars 5 forks source link

First record position out of range #28

Closed cKlee closed 6 years ago

cKlee commented 6 years ago

If numberOfRecords is something like 10, 20, 30 ... and maximumRecords ist set to 10, then a SRU DIAGNOSTIC Error is thrown: First record position out of range.

catmandu convert SRU --base http://sru.gbv.de/opac-de-1  --query 'pica.xddc=918' --recordSchema picaxml --parser picaxml
SRU DIAGNOSTIC: First record position out of range :  at /srv/zdb/prod/perl5/perlbrew/perls/perl-5.20.3/lib/site_perl/5.20.3/Catmandu/Importer/SRU.pm line 193.

I think this happens when the Importer tries to query beyond numberOfRecords, like in case of numberOfRecords = 30 and startRecord=31:

http://sru.gbv.de/opac-de-1?version=1.1&operation=searchRetrieve&query=pica.xddc%3D918&recordSchema=picaxml&startRecord=31&maximumRecords=10

See https://github.com/LibreCat/Catmandu-SRU/blob/master/lib/Catmandu/Importer/SRU.pm#L216

cKlee commented 6 years ago

Argh! I wasn't aware that there were already changes in dev. Sorry, sorry. But do these changes solve this issue?

phochste commented 6 years ago

I can't repeat these issues in the current dev branch

cKlee commented 6 years ago

Okay, then I'll close this. Thanks.