LibreCat / Catmandu-SRU

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

Add Catmandu::Store::SRU to allow counting? #46

Closed nichtich closed 4 years ago

nichtich commented 4 years ago

I tried to count the number of records in a result set without actually downloading all of them:

catmandu count SRU --base http://sru.k10plus.de/opac-de-627 --query "pica.ddc=335.83092"

This does not work because the count command is only available for Stores, not for Importers. Shall we impement Catmandu::Store::SRU or is there another way? Catmandu::Store::SRU might also provide SRU Update protocol but I doubt that anyone actually needs this. I only want to count.

nics commented 4 years ago

I would prefer to add count to importers in general

nichtich commented 4 years ago

Ok, so there is no need to extend anything in Catmandu-SRU as the Importer already has method count. It only needs to be made available via the Catmandu CLI.

nics commented 4 years ago

yes i'll look into it

nics commented 4 years ago

Turns out this was already posssible with catmandu convert SRU ... to Count. Problem was that it iterated over the results to count. The just released Catmandu 1.2013 uses the count method when available.