Lucy::...rmQuery(3pm)

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

πŸ’– Lucy::Search::TermQuery β€” the whole vibe πŸ’–

okay bestie, so this page lives in the Lucy::...rmQuery(3pm) section of the manual (yes the name got a lil truncated, it's giving mysterious but we move πŸ’…). Here's everything you need, no cap.


✨ NAME ✨

Lucy::Search::TermQuery β€” a Query that matches individual terms. That's it, that's the whole thing, she's simple and she knows it πŸŽ€


🌸 SYNOPSIS 🌸

my $term_query = Lucy::Search::TermQuery->new(
    field => 'content',
    term  => 'foo',
);
my $hits = $searcher->hits( query => $term_query );

look at her go ✨ so clean, so iconic πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

So TermQuery is a subclass of Query, and her whole job β€” her entire main character moment β€” is matching individual terms in a specific field. That's the assignment and she ate πŸ”₯


πŸŽ€ CONSTRUCTORS πŸŽ€

new

my $term_query = Lucy::Search::TermQuery->new(
    field => 'content',    # required
    term  => 'foo',        # required
);

Creates a fresh new TermQuery. Baby's first query 🍼✨

  • field β€” Field name. It's required, don't forget it bestie.
  • term β€” Term text. Also required. Both of them. No skipping πŸ™ˆ

πŸ’œ METHODS πŸ’œ

get_field

my $string = $term_query->get_field();

Accessor for the object's "field" member. Give her back the field, she gives you the string πŸ’…

get_term

my $obj = $term_query->get_term();

Accessor for the object's "term" member. Same energy, different member 🫢

make_compiler

my $compiler = $term_query->make_compiler(
    searcher    => $searcher,     # required
    boost       => $boost,        # required
    subordinate => $subordinate,  # default: false
);

Abstract factory method returning a Compiler derived from this Query. Very "build me something and I'll take it from here" energy 🧚

  • searcher β€” A Searcher.
  • boost β€” A scoring multiplier. Makes numbers go up, lowkey πŸ”₯
  • subordinate β€” Indicates 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. Yeah, that part's a whole requirement, not a suggestion, so don't play 😭

🌈 INHERITANCE 🌈

Lucy::Search::TermQuery isa Lucy::Search::Query isa Clownfish::Obj.

the whole family tree, iconic lineage πŸ‘‘


fr fr bestie, that's the entire page β€” every flag, every default, every required arg, all of it, nothing left behind πŸ’–

signed off with love from the perl v5.42.0 girlies, dated 2025-07-25, filed under Lucy::...rmQuery(3pm) β€” mwah, go write some queries πŸ’‹βœ¨

πŸ“¦ where this page comes from