Lucy::...eQuery(3pm)
π NAME π
Lucy::Search::RangeQuery β bestie, it matches a range of values. That's it, that's the whole job. Slay.
(You're reading the manual page for Lucy::...eQuery(3pm), in case you were wondering where you were. π)
β¨ SYNOPSIS β¨
# Match all articles by "Foo" published since the year 2000.
my $range_query = Lucy::Search::RangeQuery->new(
field => 'publication_date',
lower_term => '2000-01-01',
include_lower => 1,
);
my $author_query = Lucy::Search::TermQuery->new(
field => 'author_last_name',
text => 'Foo',
);
my $and_query = Lucy::Search::ANDQuery->new(
children => [ $range_query, $author_query ],
);
my $hits = $searcher->hits( query => $and_query );
...
okay so picture this: you want every article by "Foo" that dropped after the year 2000. You build a RangeQuery for the date, you build a TermQuery for the author, you smash them together with an ANDQuery, and boom β the searcher hands you hits. main character energy fr. π₯
πΈ DESCRIPTION πΈ
RangeQuery matches documents where the value for a particular field falls within a given range. No cap. It's giving "give me everything between here and there" and honestly? obsessed. π
π CONSTRUCTORS π
new
my $range_query = Lucy::Search::RangeQuery->new(
field => 'product_number', # required
lower_term => '003', # see below
upper_term => '060', # see below
include_lower => 0, # default true
include_upper => 0, # default true
);
Create a new RangeQuery. Fresh out of the box, brand new, iconic. β
Takes 5 parameters; field is required, as is at least one of either lower_term or upper_term. Like, you gotta give it something to work with, bestie. π
fieldβ The name of a"sortable"field.lower_termβ Lower delimiter. If not supplied, all values less thanupper_termwill pass.upper_termβ Upper delimiter. If not supplied, all values greater thanlower_termwill pass.include_lowerβ Indicates whether docs which matchlower_termshould be included in the results.include_upperβ Indicates whether docs which matchupper_termshould be included in the results.
π¦ METHODS π¦
make_compiler
my $compiler = $range_query->make_compiler(
searcher => $searcher, # required
boost => $boost, # required
subordinate => $subordinate, # default: false
);
Abstract factory method returning a Compiler derived from this Query. It's lowkey a factory, highkey it makes a compiler, and it is not doing the compiling itself. π
searcherβ ASearcher.boostβ A scoring multiplier.subordinateβ Indicates whether theQueryis a subquery (as opposed to a top-level query). If false, the implementation must invokenormalize()on the newly mintedCompilerobject before returning it.
okay bestie listen β thatnormalize()bit is not optional. Ifsubordinateis false and you skip it, that's on you. Don't be that girl. π
π INHERITANCE π
Lucy::Search::RangeQuery isa Lucy::Search::Query isa Clownfish::Obj.
Three generations of icon behavior. A whole family tree of slay. π
and that's the whole page, periodt. π This one's from the User Contributed Perl Documentation, shipping with perl v5.42.0, dated 2025-07-25 β so yeah, remember the date, remember the version, and go forth and query your ranges. π«Άβ¨
π¦ 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