KinoSearch::Search::RangeQuery - Match a range of values.
# Match all articles by "Foo" published since the year 2000.
my $range_query = KinoSearch::Search::RangeQuery->new(
field => 'publication_date',
lower_term => '2000-01-01',
include_lower => 1,
);
my $author_query = KinoSearch::Search::TermQuery->new(
field => 'author_last_name',
text => 'Foo',
);
my $and_query = KinoSearch::Search::ANDQuery->new;
$and_query->add_child($range_query);
$and_query->add_child($author_query);
my $hits = $searcher->search( query => $and_query );
...
RangeQuery matches documents where the value for a particular field falls within a given range.
Field values are compared lexically.
my $range_query = KinoSearch::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
);
Takes 5 parameters; field is required, as
is at least one of either lower_term or
upper_term.
indexed but not
analyzed.
upper_term will pass.
lower_term will pass.
lower_term should be included in the results.
upper_term should be included in the results.
KinoSearch::Search::RangeQuery isa KinoSearch::Search::Query isa KinoSearch::Obj.
Copyright 2005-2008 Marvin Humphrey
See KinoSearch version 0.20.