Lucy::...Matcher(3pm)
π Lucy::Search::Matcher β the vibe π
okay bestie, welcome to Lucy::Search::Matcher(3pm), the manual page for the abstract base class that matches a set of document ids. yes it's giving very "the blueprint" energy and we're obsessed π
β¨ NAME β¨
Lucy::Search::Matcher β Match a set of document ids. periodt.
πΈ SYNOPSIS πΈ
# abstract base class
that's it, that's the whole synopsis, she's mysterious like that π
π¦ DESCRIPTION π¦
so here's the tea: a Matcher iterates over a set of ascending document ids. like, they go up, always, no backtracking, no chaos π
some Matchers implement score() and can hand out relevance scores to the docs they match β main character behaviour, fr fr. other implementations may be match-only, which is also valid, we don't judge, every matcher is iconic in its own way π«Ά
π CONSTRUCTORS π
π new
my $matcher = MyMatcher->SUPER::new;
abstract constructor. that's right β you don't call this one directly, you subclass it, you do the work, you slay β¨
π ABSTRACT METHODS π
these are the ones you have to implement, no cap.
β next
my $int = $matcher->next();
proceed to the next doc id. one step forward, bestie πΆβοΈ
Returns: a positive doc id, or 0 once the iterator is exhausted. so if you get 0, she's done, the well is dry, we move on π
πΈ get_doc_id
my $int = $matcher->get_doc_id();
return the current doc id.
okay so this one is valid only after a successful call tonext()oradvance()and must not be called otherwise. like, do not call her before she's ready, that's not the vibe π
π score
my $float = $matcher->score();
return the score of the current document.
only Matchers which are used for scored search need implement score(). if you're just matching and not scoring, you can skip this, no pressure, live your truth π¦
π METHODS π
π advance
my $int = $matcher->advance($target);
advance the iterator to the first doc id greater than or equal to "target". the default implementation simply calls next() over and over (yes, a lil brute force, she's trying her best π), but subclasses have the option of doing something more efficient. glow-up opportunity!!
- target β a positive doc id, which must be greater than the current doc id once the iterator has been initialized.
Returns: a positive doc id, or 0 once the iterator is exhausted.
π§ INHERITANCE π§
Lucy::Search::Matcher isa Clownfish::Obj.
family tree ate, honestly π
and that's the whole page, bestie!! go forth and match some doc ids π
signing off with love from perl v5.42.0, dated 2025-07-25, in the house of Lucy::...Matcher(3pm) β stay ascending, stay iconic πβ¨π₯
π¦ 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