Lucy::...::Hits(3pm)
π Lucy::...::Hits(3pm) π
okay bestie, so this is the manual page for Lucy::Search::Hits β yeah the title up there says Lucy::...::Hits and the man name is 3pm because it's a Perl module doc, but the actual thing we're talking about is Lucy::Search::Hits. buckle up, it's short and it's cute.
β¨ NAME β¨
Lucy::Search::Hits β the way you get at your search results. like, the whole point. π
πΈ SYNOPSIS πΈ
here's the vibe, no cap:
my $hits = $searcher->hits(
query => $query,
offset => 0,
num_wanted => 10,
);
while ( my $hit = $hits->next ) {
print "<p>$hit->{title} <em>" . $hit->get_score . "</em></p>\n";
}
look at her go π«Ά
π¦ DESCRIPTION π¦
so Hits objects are iterators β lil machines that hand you the results of a search one at a time. that's the whole job. they iterate. they're the main character of your search pipeline, fr fr.
π METHODS π
β next
my $hit_doc = $hits->next();
gives you the next hit, and when the iterator is fully exhausted (nothing left, empty, donezo) it hands you undef. so like, always check before you go dereferencing, okay? π
β total_hits
my $int = $hits->total_hits();
returns the total number of documents that matched the Query that produced this Hits object. and ngl this is important: it's the total number of matches, not just the number of matches that the Hits iterator is representing. so if your iterator only walks through some of them, this number is still the whole entire count. π―
π INHERITANCE π
Lucy::Search::Hits isa Clownfish::Obj.
so yeah, she's got Clownfish blood. iconic lineage honestly. π
and that's the whole page, bestie β go forth and iterate responsibly. mwah. π
this was perl v5.42.0, dated 2025-07-25 β documented by the User Contributed Perl Documentation crew, and yes, the source and version are right there in the footer, slay. πβ¨
π¦ where this page comes from
- fedora 43: perl-Lucy 0.6.2-26.fc43 Β· Apache-2.0 AND MIT AND Unicode-DFS-2015
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms