Lucy::...seQuery(3pm)
β¨ NAME β¨
Lucy::Search::PhraseQuery β the query that matches an ordered list of terms π like, order MATTERS bestie, we are not playing around here.
(also hi, this lil page lives in the User Contributed Perl Documentation corner of your man pages π«Ά)
πΈ SYNOPSIS πΈ
my $phrase_query = Lucy::Search::PhraseQuery->new(
field => 'content',
terms => [qw( the who )],
);
my $hits = $searcher->hits( query => $phrase_query );
okay so you build it, you hand it to hits(), you get hits. that's the whole vibe β¨
π¦ DESCRIPTION π¦
PhraseQuery is a subclass of Query and its whole thing is matching against an ordered sequence of terms. ordered. sequence. the words gotta show up in that exact order, no cap π₯
π CONSTRUCTORS π
π new
my $phrase_query = Lucy::Search::PhraseQuery->new(
field => $field, # required
terms => $terms, # required
);
bestie this makes you a brand new PhraseQuery, slay β¨
fieldβ the field that the phrase has to occur in. (required, you cannot skip this one π)termsβ the ordered array of terms that must match. (required too, both of them, always π)
π METHODS π
β get_field
my $string = $phrase_query->get_field();
the accessor for your object's field attribute. it just hands you the field. iconic, no notes π
π get_terms
my $arrayref = $phrase_query->get_terms();
the accessor for your object's array of terms β gives you back the arrayref, as promised π
π₯ make_compiler
my $compiler = $phrase_query->make_compiler(
searcher => $searcher, # required
boost => $boost, # required
subordinate => $subordinate, # default: false
);
it's an abstract factory method that returns a Compiler derived from this Query. very main character energy, very "i don't do the work myself, i delegate" π
searcherβ aSearcher.boostβ a scoring multiplier.subordinateβ says whether theQueryis a subquery (as opposed to a top-level query). heads up: if it's false, the implementation must invokenormalize()on the newly mintedCompilerobject before returning it. like, that is not optional, that is the rule π«Ά
π INHERITANCE π
Lucy::Search::PhraseQuery isa Lucy::Search::Query isa Clownfish::Obj.
a whole little family tree, and yes she inherited the good genes β¨
k that's the whole page bestie, go match some phrases in order like the icon you are π¦π β signed, your girl, running under perl v5.42.0 and dated 2025-07-25, Lucy::...seQuery(3pm), periodt π
π¦ 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