Lucy::...DQuery(3pm)
π Lucy::Search::ANDQuery π
okay bestie, so this page is from the User Contributed Perl Documentation section of the manual, and it's all about Lucy::Search::ANDQuery β the iconic little composite query that only vibes with you when every single one of its children vibes too. it's giving "all my friends have to like you or it's a no" energy. π
β¨ NAME β¨
Lucy::Search::ANDQuery β intersect multiple result sets, periodt. π
πΈ SYNOPSIS πΈ
my $foo_and_bar_query = Lucy::Search::ANDQuery->new(
children => [ $foo_query, $bar_query ],
);
my $hits = $searcher->hits( query => $foo_and_bar_query );
...
likeβ¦ look at her. she's building a query, handing it to the searcher, getting hits. ate and left no crumbs. π
π¦ DESCRIPTION π¦
so ANDQuery is a composite Query, meaning it's made of other queries (her children, her little squad π«Ά). she matches only when all of her children match β so her result set is literally the intersection of their result sets. no stragglers, no half-matches, it's all-or-nothing bestie. π
and the docs that do match? they receive a summed score. all the children's scores get added up. math but make it cute. β
π CONSTRUCTORS π
π new π
my $foo_and_bar_query = Lucy::Search::ANDQuery->new(
children => [ $foo_query, $bar_query ],
);
creates a brand new ANDQuery, fresh out of the box, main character energy only. β¨
childrenβ an array of child Queries. that's it, that's the whole thing. your little query babies. π
π METHODS π
π§ make_compiler π§
my $compiler = $and_query->make_compiler(
searcher => $searcher, # required
boost => $boost, # required
subordinate => $subordinate, # default: false
);
an abstract factory method that returns a Compiler derived from this Query. fancy. π
searcherβ a Searcher. required, no cap. π₯boostβ a scoring multiplier. also required. πsubordinateβ tells you whether the Query is a subquery (as opposed to a top-level query). if it's false, the implementation must invokenormalize()on the newly minted Compiler object before returning it. yes, that's a must-must, not a suggestion. π
π INHERITANCE π
Lucy::Search::ANDQuery isa Lucy::Search::PolyQuery isa Lucy::Search::Query isa Clownfish::Obj.
the whole family tree, glowing, iconic, slaying. π
okay that's the whole page bestie!! this one came from perl v5.42.0, dated 2025-07-25, and honestly? she's a classic. go forth and intersect your result sets. πβ¨π¦
π¦ 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