Lucy::...rmQuery(3pm)
π 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β ASearcher.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'sfalse, the implementation must invokenormalize()on the newly mintedCompilerobject 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
- 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