Lucy::...DQuery(3pm)

πŸ“¦
version 0.6.2 Β· 2 versions
, in fedora 43

πŸ’– 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 invoke normalize() 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