LucyX:...tyQuery(3pm)
π LucyX::Search::ProximityQuery β it's giving "find my words, in order" β¨
okay bestie, welcome to the 3pm section of the manual, and this one is a whole little icon: LucyX::Search::ProximityQuery, aka the query that's like "these terms, in this order, close together, or it's not happening." πΈ
β¨ NAME β¨
LucyX::Search::ProximityQuery β a Query that matches an ordered list of terms. π
π SYNOPSIS π
my $proximity_query = LucyX::Search::ProximityQuery->new(
field => 'content',
terms => [qw( the who )],
within => 10, # match within 10 positions
);
my $hits = $searcher->hits( query => $proximity_query );
like, look at her go π«Ά β you hand her a field, a little terms array, and a within window, and she goes and finds stuff.
π¦ DESCRIPTION π¦
ProximityQuery is a subclass of Query, and her whole personality is matching against an ordered sequence of terms. no cap. π
π CONSTRUCTORS π
π§ new
my $proximity_query = LucyX::Search::ProximityQuery->new(
field => $field, # required
terms => $terms, # required
within => $within, # required
);
Create a new ProximityQuery. she's fresh, she's new, she's ready to search. β¨
fieldβ the field that the phrase has to occur in. πtermsβ the ordered array of terms that must match. the order matters, bestie, don't play. π
π METHODS π
π get_field
my $string = $proximity_query->get_field();
Accessor for the object's field attribute. lowkey just hands you back the field. πΈ
β get_terms
my $arrayref = $proximity_query->get_terms();
Accessor for the object's array of terms. it's giving arrayref. π₯
π get_within
my $int = $proximity_query->get_within();
Accessor for the object's within attribute. an int, as promised. β¨
π make_compiler
my $compiler = $proximity_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 a compiler, but make it fashion." π
searcherβ aSearcher. πboostβ a scoring multiplier. π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. not optional, not a suggestion, that's the rule. π
πΈ INHERITANCE πΈ
LucyX::Search::ProximityQuery isa Lucy::Search::Query isa Clownfish::Obj. the family tree ate, fr fr. π
and that's the whole page, bestie π this one came from perl v5.42.0, dated 2025-07-25 β shoutout to the Perl docs girlies, 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