Catmandu::Hits(3pm)
π Catmandu::Hits β bestie edition π
okay so this is Catmandu::Hits, a page straight out of the User Contributed Perl Documentation (perl v5.40.1, dated 2026-01-24, if you're keeping receipts). It's an iterable object that wraps up your Catmandu::Store search hits, like a little gift bag for your query results. π
β¨ NAME β¨
Catmandu::Hits β an iterable object that wraps Catmandu::Store search hits. That's the whole vibe. It's giving "I hold your search results and I'm cute about it." π
πΈ SYNOPSIS πΈ
Here's the whole flow, bestie, no cap:
my $store = Catmandu::Store::Solr->new;
my $hits = $store->bag->search(
query => 'dna' ,
start => 0 ,
limit => 100 ,
sort => 'title desc',
);
# Every hits is an iterator...
$hits->each(sub { ... });
printf "Found %s $hits\n" , $hits->total;
my $start = $hits->start;
my $limit = $hits->limit;
my $prev = $hits->previous_page;
my $next = $hits->next_page;
lowkey iconic, right? You make a store, you search a bag, you get hits. Then β and this is the part that matters β every hits is an iterator, so you can each your way through them like it's nothing. π«
Then you can peek at total, start, and limit, and grab your previous_page and next_page like the main character you are. π
π¦ METHODS π¦
A Catmandu::Hits object provides the following methods in addition to methods of Catmandu::Iterable and Catmandu::Paged. So like, it's already stacked, and then it has these extra ones on top. Obsessed. β¨
π total
Returns the total number of hits matching the query. That's it, that's the tea. β
π start
Returns the start index for the search results.
π limit
Returns the maximum number of search results returned.
π more
Return true if there are more search results. So if you're wondering "is there more?" β this is your girl. π«Ά
β SEE ALSO β
Go read these next, bestie, they're the whole friend group:
Catmandu::BagCatmandu::SearchableCatmandu::Store
and that's the page!! πΈπ¦π Signing off with the credits, because you know I have to: this one's from perl v5.40.1, dated 2026-01-24, and it lives at Catmandu::Hits(3pm). slay, go search something. π
β¨
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms