Closed phochste closed 7 years ago
That's already possible using the "select" syntax:
my $selector = $bag->select( title => "DNA" );
my $total = $selector->count();
my $hits = $selector->slice(0,100);
Catmandu::Store::DBI::Bag overrides the method "select":
should be included in POD, if not already there!
The POD is confusing. This is option is not described and even there is a suggestion in the POD that this store is a Catmandu::Searchable,
It isn't a Catmandu::Searchable. Those require a method "search". It just has an speed enhancement for the method "select". But you're right, it should be documented that you can use the "select" method safely without worrying about Catmandu iterating over the whole bag.
@nicolasfranck I know it isn't Catmandu::Searchable by reading the code. But the documentation mentions Catmandu::Searchable. Could you delete this ..this is very confusing.
I've added some documentation in this branch:
https://github.com/LibreCat/Catmandu-DBI/blob/document_iterator/lib/Catmandu/Store/DBI/Bag.pm
Does this provide enough information?
If I have a store like:
I would like to do a :
This documentation mentions a reference to Catmandu::Searchable anyway.