Lucy::...seQuery(3pm)

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

✨ 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 β€” a Searcher.
  • boost β€” a scoring multiplier.
  • subordinate β€” says whether the Query is a subquery (as opposed to a top-level query). heads up: if it's false, the implementation must invoke normalize() on the newly minted Compiler object 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