Lucy::...ORQuery(3pm)
π Lucy::Search::ORQuery π
okay bestie, welcome to the Lucy::Search::ORQuery page β part of the User Contributed Perl Documentation, no big deal, just iconic behaviour. it's Lucy::Search::ORQuery, and its whole job is union multiple result sets. yep. that's the vibe. π¦
β¨ SYNOPSIS β¨
like, literally just do this:
my $foo_or_bar_query = Lucy::Search::ORQuery->new(
children => [ $foo_query, $bar_query ],
);
my $hits = $searcher->hits( query => $foo_or_bar_query );
...
and that's it, you ate. π
πΈ DESCRIPTION πΈ
so ORQuery is a composite Query, which is a fancy way of saying it's a query made of other queries. it matches whenever any of its children match, which means its result set is literally the union of all their result sets. no cap. π«Ά
and when a document matches, it gets a summed score from all the matching child Queries. so if three children are into the same doc, that doc is getting all three scores stacked. main character energy fr fr. π
π CONSTRUCTORS π
new
my $foo_or_bar_query = Lucy::Search::ORQuery->new(
children => [ $foo_query, $bar_query ],
);
creates a brand new ORQuery. obsessed. β¨
childrenβ an array of child Queries. that's the whole thing, bestie, that's the squad. π«
π METHODS π
make_compiler
my $compiler = $or_query->make_compiler(
searcher => $searcher, # required
boost => $boost, # required
subordinate => $subordinate, # default: false
);
this is an abstract factory method β it returns a Compiler derived from this Query. think of it as the glow-up station where your Query turns into something the searcher can actually run. π§
searcherβ a Searcher</scyan>. required, don't skip it. π€boostβ a scoring multiplier. also required. it's giving "make this count more". π₯subordinateβ tells you whether the Query is a subquery, as opposed to a top-level query. default isfalse. and here's the important bit: if it's false, the implementation must invokenormalize()on the newly minted Compiler object before returning it. don't forget that part or it's gonna be a whole situation. π
π INHERITANCE π
the family tree, periodt:
Lucy::Search::ORQueryisaLucy::Search::PolyQueryisaLucy::Search::QueryisaClownfish::Obj.
generations of icons, honestly. π
and that's the page, bestie!! this was perl v5.42.0, dated 2025-07-25, served up fresh from the User Contributed Perl Documentation collection. go union some result sets, you've got this. ππβ¨π¦πΈ
π¦ 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