Lucy::...eQuery(3pm)

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

πŸ’– 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 than upper_term will pass.
  • upper_term β€” Upper delimiter. If not supplied, all values greater than lower_term will pass.
  • include_lower β€” Indicates whether docs which match lower_term should be included in the results.
  • include_upper β€” Indicates whether docs which match upper_term should 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 β€” A Searcher.
  • boost β€” A scoring multiplier.
  • subordinate β€” Indicates whether the Query is a subquery (as opposed to a top-level query). If false, the implementation must invoke normalize() on the newly minted Compiler object before returning it.
okay bestie listen β€” that normalize() bit is not optional. If subordinate is 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